20 Nov, 2014

1 commit


05 Jun, 2014

2 commits

  • Add plist_requeue(), which moves the specified plist_node after all other
    same-priority plist_nodes in the list. This is essentially an optimized
    plist_del() followed by plist_add().

    This is needed by swap, which (with the next patch in this set) uses a
    plist of available swap devices. When a swap device (either a swap
    partition or swap file) are added to the system with swapon(), the device
    is added to a plist, ordered by the swap device's priority. When swap
    needs to allocate a page from one of the swap devices, it takes the page
    from the first swap device on the plist, which is the highest priority
    swap device. The swap device is left in the plist until all its pages are
    used, and then removed from the plist when it becomes full.

    However, as described in man 2 swapon, swap must allocate pages from swap
    devices with the same priority in round-robin order; to do this, on each
    swap page allocation, swap uses a page from the first swap device in the
    plist, and then calls plist_requeue() to move that swap device entry to
    after any other same-priority swap devices. The next swap page allocation
    will again use a page from the first swap device in the plist and requeue
    it, and so on, resulting in round-robin usage of equal-priority swap
    devices.

    Also add plist_test_requeue() test function, for use by plist_test() to
    test plist_requeue() function.

    Signed-off-by: Dan Streetman
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Acked-by: Mel Gorman
    Cc: Paul Gortmaker
    Cc: Thomas Gleixner
    Cc: Shaohua Li
    Cc: Hugh Dickins
    Cc: Dan Streetman
    Cc: Michal Hocko
    Cc: Christian Ehrhardt
    Cc: Weijie Yang
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Bob Liu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     
  • Add PLIST_HEAD() to plist.h, equivalent to LIST_HEAD() from list.h, to
    define and initialize a struct plist_head.

    Add plist_for_each_continue() and plist_for_each_entry_continue(),
    equivalent to list_for_each_continue() and list_for_each_entry_continue(),
    to iterate over a plist continuing after the current position.

    Add plist_prev() and plist_next(), equivalent to (struct list_head*)->prev
    and ->next, implemented by list_prev_entry() and list_next_entry(), to
    access the prev/next struct plist_node entry. These are needed because
    unlike struct list_head, direct access of the prev/next struct plist_node
    isn't possible; the list must be navigated via the contained struct
    list_head. e.g. instead of accessing the prev by list_prev_entry(node,
    node_list) it can be accessed by plist_prev(node).

    Signed-off-by: Dan Streetman
    Acked-by: Mel Gorman
    Cc: Paul Gortmaker
    Cc: Steven Rostedt
    Cc: Thomas Gleixner
    Cc: Shaohua Li
    Cc: Hugh Dickins
    Cc: Dan Streetman
    Cc: Michal Hocko
    Cc: Christian Ehrhardt
    Cc: Weijie Yang
    Cc: Rik van Riel
    Cc: Johannes Weiner
    Cc: Bob Liu
    Cc: Peter Zijlstra
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Streetman
     

08 Jul, 2011

1 commit

  • This was legacy code brought over from the RT tree and
    is no longer necessary.

    Signed-off-by: Dima Zavin
    Acked-by: Thomas Gleixner
    Cc: Daniel Walker
    Cc: Steven Rostedt
    Cc: Peter Zijlstra
    Cc: Andi Kleen
    Cc: Lai Jiangshan
    Link: http://lkml.kernel.org/r/1310084879-10351-2-git-send-email-dima@android.com
    Signed-off-by: Ingo Molnar

    Dima Zavin
     

12 Mar, 2011

1 commit

  • struct plist_head is used in struct task_struct as well as struct
    rtmutex. If we can make it smaller, it will also make these structures
    smaller as well.

    The field prio_list in struct plist_head is seldom used and we can get
    its information from the plist_nodes. Removing this field will decrease
    the size of plist_head by half.

    Signed-off-by: Lai Jiangshan
    LKML-Reference:
    Signed-off-by: Steven Rostedt

    Lai Jiangshan
     

19 Jul, 2010

1 commit

  • plist is currently used by the scheduler, which only needs to know the
    highest item in the list. This adds plist_last which allows you to
    find the lowest. This is necessary for using plists to implement a
    fast search of dynamic ranges in pm_qos which can have both highest
    and lowest criteria.

    Signed-off-by: James Bottomley
    Signed-off-by: Rafael J. Wysocki

    James Bottomley
     

13 Jan, 2010

1 commit


15 Dec, 2009

1 commit


29 Dec, 2008

1 commit


18 Apr, 2007

1 commit

  • Make kernel-doc comments match macro names.
    Correct parameter names in a few places.
    Remove '#' from beginning of kernel-doc comment macro names.
    Remove extra (erroneous) blank lines in kernel-doc.

    Warning(plist.h:100): Cannot understand * #PLIST_HEAD_INIT - static struct plist_head initializer on line 100 - I thought it was a doc line
    Warning(plist.h:112): Cannot understand * #PLIST_NODE_INIT - static struct plist_node initializer on line 112 - I thought it was a doc line
    Warning(plist.h:103): No description found for parameter '_lock'
    Warning(plist.h:129): No description found for parameter 'lock'
    Warning(plist.h:158): No description found for parameter 'pos'
    Warning(plist.h:169): No description found for parameter 'pos'
    Warning(plist.h:169): No description found for parameter 'n'
    Warning(plist.h:179): No description found for parameter 'mem'

    This still leaves one warning & one error that need attention:
    Error(plist.h:219): cannot understand prototype: '('
    Warning(plist.h): no structured comments found

    Acked-by: Inaky Perez-Gonzalez
    Cc: Daniel Walker
    Cc: Thomas Gleixner
    Cc: Oleg Nesterov
    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

29 Jun, 2006

1 commit


28 Jun, 2006

1 commit