[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140513103323.GN23991@suse.de>
Date: Tue, 13 May 2014 11:33:23 +0100
From: Mel Gorman <mgorman@...e.de>
To: Dan Streetman <ddstreet@...e.org>
Cc: Hugh Dickins <hughd@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Michal Hocko <mhocko@...e.cz>,
Christian Ehrhardt <ehrhardt@...ux.vnet.ibm.com>,
Weijie Yang <weijieut@...il.com>,
Rik van Riel <riel@...hat.com>,
Johannes Weiner <hannes@...xchg.org>,
Bob Liu <bob.liu@...cle.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, Steven Rostedt <rostedt@...dmis.org>,
Peter Zijlstra <peterz@...radead.org>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Thomas Gleixner <tglx@...utronix.de>
Subject: Re: [PATCHv2 3/4] plist: add plist_requeue
On Mon, May 12, 2014 at 12:38:19PM -0400, Dan Streetman wrote:
> 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 <ddstreet@...e.org>
> Cc: Steven Rostedt <rostedt@...dmis.org>
> Cc: Peter Zijlstra <peterz@...radead.org>
> Cc: Mel Gorman <mgorman@...e.de>
> Cc: Paul Gortmaker <paul.gortmaker@...driver.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
>
Acked-by: Mel Gorman <mgorman@...e.de>
--
Mel Gorman
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists