#125 swapon02 failure, MAX_SWAPFILES problem

System Calls
closed-later
nobody
Testcases (113)
5
2007-07-24
2007-06-15
No

If CONFIG_MIGRATION is set in the linux kernel, MAX_SWAPFILES is really MAX_SWAPFILES - 2. :(

the failure looks like this:

./swapon02
swapon02 1 PASS : swapon(2) expected failure; Got errno - ENOENT : Path does not exist
swapon02 2 PASS : swapon(2) expected failure; Got errno - EINVAL : Invalid path
swapon02 0 WARN : Failed swapon for file swapfile31 returned -1
swapon02 0 WARN : Failed to turn off swap files. system reboot after execution of LTP test suite is recommended
swapon02 0 WARN : Failed to turn off swap files. system reboot after execution of LTP test suite is recommended
swapon02 3 BROK : Cleanup failed, quitting the test
swapon02 4 BROK : Remaining cases broken
swapon02 5 BROK : Remaining cases broken

Discussion

  • rsalveti

    rsalveti - 2007-06-21

    Logged In: YES
    user_id=1269623
    Originator: NO

    Yep, since kernel's commit http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=0697212a411c1dae03c27845f2de2f3adb32c331 the value of MAX_SWAPFILES is depending on kernel config option CONFIG_MIGRATION.

    The code:
    /*
    * MAX_SWAPFILES defines the maximum number of swaptypes: things which can
    * be swapped to. The swap type and the offset into that swap type are
    * encoded into pte's and into pgoff_t's in the swapcache. Using five bits
    * for the type means that the maximum number of swapcache pages is 27 bits
    * on 32-bit-pgoff_t architectures. And that assumes that the architecture packs
    * the type/offset into the pte as 5/27 as well.
    */
    #define MAX_SWAPFILES_SHIFT 5
    #ifndef CONFIG_MIGRATION
    #define MAX_SWAPFILES (1 << MAX_SWAPFILES_SHIFT)
    #else
    /* Use last two entries for page migration swap entries */
    #define MAX_SWAPFILES ((1 << MAX_SWAPFILES_SHIFT)-2)
    #define SWP_MIGRATION_READ MAX_SWAPFILES
    #define SWP_MIGRATION_WRITE (MAX_SWAPFILES + 1)
    #endif

    I don't think that there's a simple way to fix this problem.

     
  • Subrata Modak

    Subrata Modak - 2007-06-27
    • status: open --> pending-later
     
  • SourceForge Robot

    Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

     
  • SourceForge Robot

    • status: pending-later --> closed-later
     
  • Zing Shishak

    Zing Shishak - 2007-07-13
    • status: closed-later --> open-later
     
  • Subrata Modak

    Subrata Modak - 2007-07-24

    Logged In: YES
    user_id=1737361
    Originator: NO

    See Ricardo's Comment below

     
  • Subrata Modak

    Subrata Modak - 2007-07-24
    • status: open-later --> closed-later
     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks