From: Garrett C. <yan...@gm...> - 2010-03-13 07:32:45
|
On Thu, Mar 11, 2010 at 7:48 AM, Murlin Wenzel <mw...@no...> wrote: >>>> On 3/10/2010 at 05:15 AM, in message > <201...@li...>, Rishikesh K Rajak > <ris...@li...> wrote: >> On Thu, Feb 25, 2010 at 11:56:15AM +0530, Rishikesh K Rajak wrote: >>> On Wed, Feb 24, 2010 at 05:08:56PM -0800, Garrett Cooper wrote: >>> > On Wed, Feb 24, 2010 at 3:49 PM, Murlin Wenzel <mw...@no...> wrote: >>> > > Added clean_swap() to cleanup routine. This makes sure all leftover swap >> files are removed. >>> > > >>> > > Signed-off-By: Murlin Ray Wenzel mw...@no... >>> > >>> > Committed -- thanks! >>> > -Garrett >>> >>> Thanks Garret & Murlin. >> >> >> Hi Murlin, >> >> can you please look into this failure as it still fails on my SLES11 & >> RHEl5.4 >> boxes. >> >> [root@mx3455a bin]# ./swapon03 >> swapon03 1 TFAIL : Failed swapon for file swapfile29: errno=EPERM(1): >> Operation not permitted >> swapon03 0 TWARN : tst_rmdir(): rmobj(/tmp/swasf2sLb) failed: >> unlink(/tmp/swasf2sLb/swapfile22) failed; errno=1: Operation not permitted >> swapon03 1 TFAIL : Failed to setup swaps >> >> attached is the strace log. > > That's the other part of the problem that I'm not sure what to do with yet. The original test was written entirely based on the assumption that there were always a max of 30 swap files available. With newer kernels (SLE11 RHEL5.4) the kernel can be configured so that the max could be as low as 29 if not 28. The kernel is doing the right thing returning EPERM, but the test needs to be re-worked to deal with new maximum limits/possibilites. It should actually be KERNEL_MAX - (CONFIG_MIGRATION enabled ? 2 : 0) - used_swap_devices ... NOTES The partition or path must be prepared with mkswap(8). There is an upper limit on the number of swap files that may be used, defined by the kernel constant MAX_SWAPFILES. Before kernel 2.4.10, MAX_SWAPFILES has the value 8; since kernel 2.4.10, it has the value 32. Since kernel 2.6.18, the limit is decreased by 2 (thus: 30) if the kernel is built with the CONFIG_MIGRATION option (which reserves two swap table entries for the page migration features of mbind(2) and migrate_pages(2)). The fun unknown is CONFIG_MIGRATION -- how do you know whether or not this is set from userspace? There's too much handwaving in this testcase that needs to be fixed. Thanks, -Garrett |