Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-05-04 Thread Dan Streetman
On Sun, May 4, 2014 at 5:39 AM, Bob Liu wrote: > > On 05/03/2014 04:00 AM, Dan Streetman wrote: >> On Fri, Apr 25, 2014 at 12:15 AM, Weijie Yang >> wrote: >>> On Fri, Apr 25, 2014 at 2:48 AM, Dan Streetman wrote: On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote: > On Sat, Apr 12, 201

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-05-04 Thread Bob Liu
On 05/03/2014 04:00 AM, Dan Streetman wrote: > On Fri, Apr 25, 2014 at 12:15 AM, Weijie Yang > wrote: >> On Fri, Apr 25, 2014 at 2:48 AM, Dan Streetman wrote: >>> On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote: On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote: > > dif

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-05-02 Thread Dan Streetman
On Fri, Apr 25, 2014 at 12:15 AM, Weijie Yang wrote: > On Fri, Apr 25, 2014 at 2:48 AM, Dan Streetman wrote: >> On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote: >>> On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote: diff --git a/mm/frontswap.c b/mm/frontswap.c index 1b24

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-25 Thread Mel Gorman
On Thu, Apr 24, 2014 at 02:48:43PM -0400, Dan Streetman wrote: > >> > >> - } > >> - > >> + list_for_each(tmp, &swap_list_head) { > >> + si = list_entry(tmp, typeof(*si), list); > >> spin_lock(&si->lock); > >> - if (!si->highest_bit) { > >> -

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-24 Thread Weijie Yang
On Fri, Apr 25, 2014 at 2:48 AM, Dan Streetman wrote: > On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote: >> On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote: >>> Replace the singly-linked list tracking active, i.e. swapon'ed, >>> swap_info_struct entries with a doubly-linked list u

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-24 Thread Dan Streetman
On Wed, Apr 23, 2014 at 6:34 AM, Mel Gorman wrote: > On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote: >> Replace the singly-linked list tracking active, i.e. swapon'ed, >> swap_info_struct entries with a doubly-linked list using struct list_heads. >> Simplify the logic iterating and

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-24 Thread Mel Gorman
On Thu, Apr 24, 2014 at 08:17:05AM +0800, Shaohua Li wrote: > On Wed, Apr 23, 2014 at 11:34:00AM +0100, Mel Gorman wrote: > > > @@ -366,7 +361,7 @@ static int __frontswap_unuse_pages(unsigned long > > > total, unsigned long *unused, > > > } > > > vm_unacct_memory(pages); > > >

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-23 Thread Shaohua Li
On Wed, Apr 23, 2014 at 11:34:00AM +0100, Mel Gorman wrote: > > @@ -366,7 +361,7 @@ static int __frontswap_unuse_pages(unsigned long total, > > unsigned long *unused, > > } > > vm_unacct_memory(pages); > > *unused = pages_to_unuse; > > - *swapid = type

Re: [PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-23 Thread Mel Gorman
On Sat, Apr 12, 2014 at 05:00:53PM -0400, Dan Streetman wrote: > Replace the singly-linked list tracking active, i.e. swapon'ed, > swap_info_struct entries with a doubly-linked list using struct list_heads. > Simplify the logic iterating and manipulating the list of entries, > especially get_swap_p

[PATCH 1/2] swap: change swap_info singly-linked list to list_head

2014-04-12 Thread Dan Streetman
Replace the singly-linked list tracking active, i.e. swapon'ed, swap_info_struct entries with a doubly-linked list using struct list_heads. Simplify the logic iterating and manipulating the list of entries, especially get_swap_page(), by using standard list_head functions, and removing the highest