From: Caspar Z. <cz...@re...> - 2010-07-19 05:42:11
|
----- "Garrett Cooper" <yan...@gm...> wrote: > On Wed, Jul 14, 2010 at 7:33 AM, Murlin Wenzel <mw...@no...> > wrote: > >>>> On 7/14/2010 at 07:03 AM, in message > > > <126...@zm...dhat > > com>, Caspar Zhang <cz...@re...> wrote: > >> Hi all, I find a FAIL result in syscalls/swapon03 with RHEL6 > kernel, > >> on a x86_64 machine, it always fails with the following message: > >> > >> swapon03 1 TFAIL : Failed swapon for file swapfile30: > errno=EPERM(1): > >> Operation not permitted > >> swapon03 1 TFAIL : Failed to setup swaps > >> > >> This is because in some >=2.6.32 kernels, the > >> CONFIG_MEMORY_FAILURE option is enabled by default in kernel. > >> As the NOTES in man 2 swapon says: > >> > >> "...Since kernel 2.6.32, the limit is decreased by 1 if the kernel > is built > >> with the CONFIG_MEMORY_FAILURE option..." > >> > > > > That's not the only option that affects MAX_SWAPFILES now. > > > >> so MAX_SWAPFILES is not 30 anymore, it's 29. While LTP defines > MAX_SWAPFILES > >> to 30 in include/swaponoff.h(hmmm....hardcode, I don't think it's a > good > >> idea :-|). > >> > >> So the way to solve(maybe) the problem is clear: change > MAX_SWAPFILES > >> to 29 when CONFIG_MEMORY_FAILURE is enabled. My question is: is > there > >> a good way to check whether a kernel option is enabled or not? I > searched > >> in the old discussions in this maillist and found nothing. I want > to know if > >> > >> the developers have some new ideas? > >> > > > > I've seen 28 as the MAX as well, it all depends on the config > options. I've been looking at re-architecting the test to do some > sort of repeat test to the max number of successful swap creations and > then verifying that the same number is reachable at least 2 times. > MAX_SWAPFILES is never exported to userspace. It's a compile time > #define that depends on the kernel config options. > > What about /proc/config.gz (or something similar)? Seems like a > simple enough thing to check for absolute clarity... don't remember > the kernel option for that though. /proc/config.gz doesn't existed on some platforms(which doesn't enable corresponding kernel option), as well as /boot/config-`uname -r`. It's not a safe way to find kernel option by search the config file. Thanks, Caspar -- Kernel Associate Quality Engineer Red Hat Inc. (Beijing R&D Branch) Red Hat China R&D Branch Unit 907, North Tower C, Raycom Infotech Park, No.2 Kexueyuan Nanlu, Haidian District, Beijing 100190 TEL: +86-10-62608150 Web: http://www.redhat.com/ |