Checking if running kernel compiled with CONFIG_PREEMPT
by planetf1
I have a 2.6.31 kernel from F12.
I believe I've built it with CONFIG_PREEMPT but given the intracacies of
the rpm build, what's the easiest way to check an installed kernel to
see if that flag had been used during build?
Thanks
Nigel.
13 years, 11 months
CONFIG_INTEL_TXT
by Stephen Smalley
Would it be possible to get CONFIG_INTEL_TXT enabled in the Fedora
kernel x86 and x86_64 configs going forward?
Thanks.
--
Stephen Smalley
National Security Agency
13 years, 11 months
Kernel Option Classifications
by Steve Dickson
Does anybody know if so wiki or guidelines out there
that defines how kernel option should be classified?
Meaning what does it really means to be 'EXPERIMENTAL' or
'DEVELOPER ONLY'. Are there any criteria that has to
be met to change them or is simply up to the maintainer's
discretion?
tia,
steved.
13 years, 11 months
candidate patches for Dell laptops and netbooks
by Matt Domsch
Mario Limonciello is a Dell engineer and contributor to Ubuntu. In
particular, he's been working on making sure Dell's notebooks and
netbooks work with Ubuntu and therefore very recent kernels. He's run
into a few fairly annoying problems, and has patches which will be
carried in the Ubuntu kernel. He sent them to me, to see if Fedora 12
wants to pick up the same changes, or just wait until they all hit
mainline. So I send them here, for your consideration.
1) Handling the rfkill switch on the Dell Mini {9,10,12,10v} and
Inspiron 11z netbooks. These enable the wireless drivers to recognize
and respond to the value of the physical rfkill switch. Without
these, if Fedora is started with the rfkill switch off, the wireless
driver loads but can't drive the hardware. Flipping the switch on,
the driver can't respond, and wireless remains disabled. Either a
manual modprobe -r; modprobe of the wireless driver, or a reboot is
necessary for the driver to recognize that the rfkill switch setting
is to enable wireless.
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=fff16e...
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=218f25...
2) bluetooth enable/disable work from mjg. He's pushing a different
approach into upstream, but this enables bluetooth + rfkill in
2.6.31ish kernels.
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=c1e755...
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=d83364...
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=09c730...
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=e6cc51...
3) load the dell-wmi driver on all Dell laptops. This is a bit of a
hack, as it causes the dell-wmi driver to load, even on laptops where
it isn't necessary. However, 2.6.31 lacks the ability to selectively
enable WMI hotkey messaging, and loading the driver on laptops where
it isn't necessary does nothing (except take a bit of memory). WMI
hotkeys are necessary on a growing number of laptops as they are the
only method to indicate a keypress for some keys.
http://kernel.ubuntu.com/git?p=ubuntu/ubuntu-karmic.git;a=commit;h=a532d8...
Thanks,
Matt
--
Matt Domsch
Technology Strategist, Dell Office of the CTO
linux.dell.com & www.dell.com/linux
13 years, 11 months
[RFE] x86_64 kernel running in i386 distribution
by Xose Vazquez Perez
hi,
would it be possible to adapt the i386 distribucion
to run also the x86_64 kernel ?
-thanks-
--
«Allá muevan feroz guerra, ciegos reyes por un palmo más de tierra;
que yo aquí tengo por mío cuanto abarca el mar bravío, a quien nadie
impuso leyes. Y no hay playa, sea cualquiera, ni bandera de esplendor,
que no sienta mi derecho y dé pecho a mi valor.»
13 years, 11 months
[Fedora PATCH] Improve Resource Counter Scalability
by Prarit Bhargava
This patch was sent to me by Balbir Singh, cc'd, who worked on the original
patch. The patch results in a massive increase in performance on a 64p/32G
system. The patch was successfully compiled and tested by me on fedora-latest.
>From the upstream commit:
"Data from Prarit (kernel compile with make -j64 on a 64
CPU/32G machine)
For a single run
Without patch
real 27m8.988s
user 87m24.916s
sys 382m6.037s
With patch
real 4m18.607s
user 84m58.943s
sys 50m52.682s
With config turned off
real 4m54.972s
user 90m13.456s
sys 50m19.711s
NOTE: The data looks counterintuitive due to the increased performance
with the patch, even over the config being turned off. We probably need
more runs, but so far all testing has shown that the patches definitely
help."
-------------------------------------------------------------------------------
Backport 0c3e73e84fe3f64cf1c2e8bb4e91e8901cbcdc38
From: Balbir Singh <balbir(a)linux.vnet.ibm.com>
(memcg: improve resource counter scalability) to 2.6.31.
It is a very useful patch for non-users of memory control
group as it reduces the overhead quite significantly.
Signed-off-by: Balbir Singh <balbir(a)linux.vnet.ibm.com>
---
mm/memcontrol.c | 127 ++++++++++++++++++++++++++++++++++++++++++++++---------
1 files changed, 106 insertions(+), 21 deletions(-)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index fd4529d..4821be0 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -43,6 +43,7 @@
struct cgroup_subsys mem_cgroup_subsys __read_mostly;
#define MEM_CGROUP_RECLAIM_RETRIES 5
+struct mem_cgroup *root_mem_cgroup __read_mostly;
#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
/* Turned on only when memory cgroup is enabled && really_do_swap_account = 1 */
@@ -66,6 +67,7 @@ enum mem_cgroup_stat_index {
MEM_CGROUP_STAT_MAPPED_FILE, /* # of pages charged as file rss */
MEM_CGROUP_STAT_PGPGIN_COUNT, /* # of pages paged in */
MEM_CGROUP_STAT_PGPGOUT_COUNT, /* # of pages paged out */
+ MEM_CGROUP_STAT_SWAPOUT, /* # of pages, swapped out */
MEM_CGROUP_STAT_NSTATS,
};
@@ -219,11 +221,24 @@ static void mem_cgroup_get(struct mem_cgroup *mem);
static void mem_cgroup_put(struct mem_cgroup *mem);
static struct mem_cgroup *parent_mem_cgroup(struct mem_cgroup *mem);
+static void mem_cgroup_swap_statistics(struct mem_cgroup *mem,
+ bool charge)
+{
+ int val = (charge) ? 1 : -1;
+ struct mem_cgroup_stat *stat = &mem->stat;
+ struct mem_cgroup_stat_cpu *cpustat;
+ int cpu = get_cpu();
+
+ cpustat = &stat->cpustat[cpu];
+ __mem_cgroup_stat_add_safe(cpustat, MEM_CGROUP_STAT_SWAPOUT, val);
+ put_cpu();
+}
+
static void mem_cgroup_charge_statistics(struct mem_cgroup *mem,
struct page_cgroup *pc,
bool charge)
{
- int val = (charge)? 1 : -1;
+ int val = (charge) ? 1 : -1;
struct mem_cgroup_stat *stat = &mem->stat;
struct mem_cgroup_stat_cpu *cpustat;
int cpu = get_cpu();
@@ -354,6 +369,11 @@ static int mem_cgroup_walk_tree(struct mem_cgroup *root, void *data,
return ret;
}
+static inline bool mem_cgroup_is_root(struct mem_cgroup *mem)
+{
+ return (mem == root_mem_cgroup);
+}
+
/*
* Following LRU functions are allowed to be used without PCG_LOCK.
* Operations are called by routine of global LRU independently from memcg.
@@ -996,9 +1016,11 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
VM_BUG_ON(css_is_removed(&mem->css));
while (1) {
- int ret;
+ int ret = 0;
bool noswap = false;
+ if (mem_cgroup_is_root(mem))
+ goto done;
ret = res_counter_charge(&mem->res, PAGE_SIZE, &fail_res);
if (likely(!ret)) {
if (!do_swap_account)
@@ -1046,6 +1068,7 @@ static int __mem_cgroup_try_charge(struct mm_struct *mm,
goto nomem;
}
}
+done:
return 0;
nomem:
css_put(&mem->css);
@@ -1119,9 +1142,11 @@ static void __mem_cgroup_commit_charge(struct mem_cgroup *mem,
lock_page_cgroup(pc);
if (unlikely(PageCgroupUsed(pc))) {
unlock_page_cgroup(pc);
- res_counter_uncharge(&mem->res, PAGE_SIZE);
- if (do_swap_account)
- res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(mem)) {
+ res_counter_uncharge(&mem->res, PAGE_SIZE);
+ if (do_swap_account)
+ res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ }
css_put(&mem->css);
return;
}
@@ -1178,7 +1203,8 @@ static int mem_cgroup_move_account(struct page_cgroup *pc,
if (pc->mem_cgroup != from)
goto out;
- res_counter_uncharge(&from->res, PAGE_SIZE);
+ if (!mem_cgroup_is_root(from))
+ res_counter_uncharge(&from->res, PAGE_SIZE);
mem_cgroup_charge_statistics(from, pc, false);
page = pc->page;
@@ -1197,7 +1223,7 @@ static int mem_cgroup_move_account(struct page_cgroup *pc,
1);
}
- if (do_swap_account)
+ if (do_swap_account && !mem_cgroup_is_root(from))
res_counter_uncharge(&from->memsw, PAGE_SIZE);
css_put(&from->css);
@@ -1268,9 +1294,11 @@ uncharge:
/* drop extra refcnt by try_charge() */
css_put(&parent->css);
/* uncharge if move fails */
- res_counter_uncharge(&parent->res, PAGE_SIZE);
- if (do_swap_account)
- res_counter_uncharge(&parent->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(parent)) {
+ res_counter_uncharge(&parent->res, PAGE_SIZE);
+ if (do_swap_account)
+ res_counter_uncharge(&parent->memsw, PAGE_SIZE);
+ }
return ret;
}
@@ -1459,7 +1487,9 @@ __mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr,
* This recorded memcg can be obsolete one. So, avoid
* calling css_tryget
*/
- res_counter_uncharge(&memcg->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(memcg))
+ res_counter_uncharge(&memcg->memsw, PAGE_SIZE);
+ mem_cgroup_swap_statistics(memcg, false);
mem_cgroup_put(memcg);
}
rcu_read_unlock();
@@ -1484,9 +1514,11 @@ void mem_cgroup_cancel_charge_swapin(struct mem_cgroup *mem)
return;
if (!mem)
return;
- res_counter_uncharge(&mem->res, PAGE_SIZE);
- if (do_swap_account)
- res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(mem)) {
+ res_counter_uncharge(&mem->res, PAGE_SIZE);
+ if (do_swap_account)
+ res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ }
css_put(&mem->css);
}
@@ -1538,9 +1570,14 @@ __mem_cgroup_uncharge_common(struct page *page, enum charge_type ctype)
break;
}
- res_counter_uncharge(&mem->res, PAGE_SIZE);
- if (do_swap_account && (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT))
- res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(mem)) {
+ res_counter_uncharge(&mem->res, PAGE_SIZE);
+ if (do_swap_account &&
+ (ctype != MEM_CGROUP_CHARGE_TYPE_SWAPOUT))
+ res_counter_uncharge(&mem->memsw, PAGE_SIZE);
+ }
+ if (ctype == MEM_CGROUP_CHARGE_TYPE_SWAPOUT)
+ mem_cgroup_swap_statistics(mem, true);
mem_cgroup_charge_statistics(mem, pc, false);
ClearPageCgroupUsed(pc);
@@ -1629,7 +1666,9 @@ void mem_cgroup_uncharge_swap(swp_entry_t ent)
* We uncharge this because swap is freed.
* This memcg can be obsolete one. We avoid calling css_tryget
*/
- res_counter_uncharge(&memcg->memsw, PAGE_SIZE);
+ if (!mem_cgroup_is_root(memcg))
+ res_counter_uncharge(&memcg->memsw, PAGE_SIZE);
+ mem_cgroup_swap_statistics(memcg, false);
mem_cgroup_put(memcg);
}
rcu_read_unlock();
@@ -2046,20 +2085,64 @@ static int mem_cgroup_hierarchy_write(struct cgroup *cont, struct cftype *cft,
return retval;
}
+struct mem_cgroup_idx_data {
+ s64 val;
+ enum mem_cgroup_stat_index idx;
+};
+
+static int
+mem_cgroup_get_idx_stat(struct mem_cgroup *mem, void *data)
+{
+ struct mem_cgroup_idx_data *d = data;
+ d->val += mem_cgroup_read_stat(&mem->stat, d->idx);
+ return 0;
+}
+
+static void
+mem_cgroup_get_recursive_idx_stat(struct mem_cgroup *mem,
+ enum mem_cgroup_stat_index idx, s64 *val)
+{
+ struct mem_cgroup_idx_data d;
+ d.idx = idx;
+ d.val = 0;
+ mem_cgroup_walk_tree(mem, &d, mem_cgroup_get_idx_stat);
+ *val = d.val;
+}
+
static u64 mem_cgroup_read(struct cgroup *cont, struct cftype *cft)
{
struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
- u64 val = 0;
+ u64 idx_val, val;
int type, name;
type = MEMFILE_TYPE(cft->private);
name = MEMFILE_ATTR(cft->private);
switch (type) {
case _MEM:
- val = res_counter_read_u64(&mem->res, name);
+ if (name == RES_USAGE && mem_cgroup_is_root(mem)) {
+ mem_cgroup_get_recursive_idx_stat(mem,
+ MEM_CGROUP_STAT_CACHE, &idx_val);
+ val = idx_val;
+ mem_cgroup_get_recursive_idx_stat(mem,
+ MEM_CGROUP_STAT_RSS, &idx_val);
+ val += idx_val;
+ val <<= PAGE_SHIFT;
+ } else
+ val = res_counter_read_u64(&mem->res, name);
break;
case _MEMSWAP:
- val = res_counter_read_u64(&mem->memsw, name);
+ if (name == RES_USAGE && mem_cgroup_is_root(mem)) {
+ mem_cgroup_get_recursive_idx_stat(mem,
+ MEM_CGROUP_STAT_CACHE, &idx_val);
+ val = idx_val;
+ mem_cgroup_get_recursive_idx_stat(mem,
+ MEM_CGROUP_STAT_RSS, &idx_val);
+ val += idx_val;
+ mem_cgroup_get_recursive_idx_stat(mem,
+ MEM_CGROUP_STAT_SWAPOUT, &idx_val);
+ val <<= PAGE_SHIFT;
+ } else
+ val = res_counter_read_u64(&mem->memsw, name);
break;
default:
BUG();
@@ -2548,6 +2631,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
/* root ? */
if (cont->parent == NULL) {
enable_swap_cgroup();
+ root_mem_cgroup = mem;
parent = NULL;
} else {
parent = mem_cgroup_from_cont(cont->parent);
@@ -2577,6 +2661,7 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup *cont)
return &mem->css;
free_out:
__mem_cgroup_free(mem);
+ root_mem_cgroup = NULL;
return ERR_PTR(error);
}
13 years, 11 months
Critical patches for the kernel
by Steven Rostedt
FYI,
Linus just pulled in two patches that are critical for ftrace. These are
needed for every kernel since 2.6.28. GregKH has already been informed
and will be pulling them into the stable releases.
3279ba37db5d65c4ab0dcdee3b211ccb85bb563f
and
e7247a15ff3bbdab0a8b402dffa1171e5c05a8e0
Please make sure they are applied to the Fedora kernel.
Thanks,
-- Steve
13 years, 11 months
Re: update kernel in liveusb
by Xose Vazquez Perez
On 09/26/2009 06:18 PM, Stewart Adam wrote:
> On 2009/09/13 9:28 AM, Xose Vazquez Perez wrote:
>> hi,
>>
>> is there a _easy and fast_ way to update the kernel in the
>> liveusb distribution ?
> You can find out more information about this process by taking at the
> tools in the livecd-tools repository on Fedora Hosted... But in short it
> seems this goes into /etc/sysconfig/mkinitrd:
I call this the hard and long way ;-)
> LIVEOS=yes
> PROBE=no
> MODULES+="squashfs ext4 ext3 ext2 vfat msdos "
> MODULES+="sr_mod sd_mod ide-cd cdrom "
> MODULES+="ehci_hcd uhci_hcd ohci_hcd "
> MODULES+="usb_storage usbhid "
> MODULES+="firewire-sbp2 firewire-ohci "
> MODULES+="sbp2 ohci1394 ieee1394 "
> MODULES+="mmc_block sdhci sdhci-pci "
> MODULES+="pata_pcmcia "
> MODULES+="=ata sym53c8xx aic7xxx mptsas udf"
>
> I'm not sure about the =ata part, that's what seems to happen when you
> follow the script's logic in imgcreate/live.py. Give it a try, but if
> mkinitrd fails to work then try removing the "=" from the beginning of
> "=ata" or even just remove "=ata" completely.
>
Original initrd brings more modules:
aic7xxx ata_generic crc-itu-t drm ext2 fat firewire-core firewire-ohci firewire-sbp2 i2c-algo-bit i2c-core i810 i830 i915 mga mmc_block mmc_core mptbase mptsas mptscsih msdos nouveau output pata_acpi pata_ali pata_amd pata_artop pata_atiixp pata_cmd640 pata_cmd64x pata_cs5520 pata_cs5530 pata_cs5535 pata_cs5536 pata_cypress pata_efar pata_hpt366 pata_hpt37x pata_hpt3x2n pata_hpt3x3 pata_it8213 pata_it821x pata_jmicron pata_marvell pata_mpiix pata_netcell pata_ninja32 pata_ns87410 pata_ns87415 pata_oldpiix pata_optidma pata_opti pata_pcmcia pata_pdc2027x pata_pdc202xx_old pata_qdi pata_sch pata_serverworks pata_sil680 pata_sis pata_sl82c105 pata_triflex pata_via r128 radeon sata_inic162x sata_mv sata_nv sata_promise sata_qstor sata_sil24 sata_sil sata_sis sata_svw sata_sx4 sata_uli sata_via sata_vsc savage scsi_transport_sas scsi_transport_spi sdhci sdhci-pci sis squashfs sym53c8xx tdfx udf usb-storage vfat via video
I get the list doing:
$ cp initrd0.img img.gz ; gunzip img.gz
$ mkdir d ; cd d ; cpio -idv < ../img
$ (for i in `find . | grep "\.ko$"`; do basename $i | sed 's/.ko//' ; done ) | sort
> Once /etc/sysconfig/mkinitrd file is in place, create your new initrd
> image with mkinitrd (remember if applicable to restore the system's
> /etc/sysconfig/mkinitrd back). Then, copy your newly created initrd
> image and kernel image (/boot/vmlinuz-$version) into the "sysconfig"
> directory of the LiveUSB and change the syslinux or grub boot
> configuration files appropriately (these are also in the syslinux/
> directory on the USB key).
here I use mkliveinitrd.
*I believe it should have a easiest way to do it.*
-thanks-
regards,
--
«Allá muevan feroz guerra, ciegos reyes por un palmo más de tierra;
que yo aquí tengo por mío cuanto abarca el mar bravío, a quien nadie
impuso leyes. Y no hay playa, sea cualquiera, ni bandera de esplendor,
que no sienta mi derecho y dé pecho a mi valor.»
13 years, 12 months