Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-17 Thread Alexander Duyck
> @@ -1691,17 +1680,34 @@ static unsigned long isolate_lru_pages(unsigned long > nr_to_scan, > * only when the page is being freed somewhere else. > */ > scan += nr_pages; > - switch (__isolate_lru_page(page, mode)) { > +

[RFC PATCH 0/3] Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alexander Duyck
Here are the patches I had discussed earlier to address the issues in isolate_migratepages_block. They are based on the tree at: https://github.com/alexshi/linux.git lrunext The first patch is mostly cleanup to address the RCU locking in the function. The second addresses the test_and_set_skip

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alex Shi
在 2020/8/13 上午10:17, Alexander Duyck 写道: >> zone lock is probability better. you can try and test. > So I spent a good chunk of today looking the code over and what I > realized is that we probably don't even really need to have this code > protected by the zone lock since the LRU bit in the

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alexander Duyck
On Wed, Aug 12, 2020 at 6:47 PM Alex Shi wrote: > > > > 在 2020/8/13 上午12:51, Alexander Duyck 写道: > > On Wed, Aug 12, 2020 at 4:44 AM Alex Shi wrote: > >> > >> > >> > >> 在 2020/8/11 下午10:47, Alexander Duyck 写道: > >>> On Tue, Aug 11, 2020 at 1:23 AM Alex Shi > >>> wrote: > > > >

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alex Shi
在 2020/8/13 上午12:51, Alexander Duyck 写道: > On Wed, Aug 12, 2020 at 4:44 AM Alex Shi wrote: >> >> >> >> 在 2020/8/11 下午10:47, Alexander Duyck 写道: >>> On Tue, Aug 11, 2020 at 1:23 AM Alex Shi wrote: 在 2020/8/10 下午10:41, Alexander Duyck 写道: > On Mon, Aug 10, 2020 at 6:10

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alexander Duyck
On Wed, Aug 12, 2020 at 4:44 AM Alex Shi wrote: > > > > 在 2020/8/11 下午10:47, Alexander Duyck 写道: > > On Tue, Aug 11, 2020 at 1:23 AM Alex Shi wrote: > >> > >> > >> > >> 在 2020/8/10 下午10:41, Alexander Duyck 写道: > >>> On Mon, Aug 10, 2020 at 6:10 AM Alex Shi > >>> wrote: > > > >

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alex Shi
在 2020/8/12 下午7:43, Alex Shi 写道: >>> Sorry, I still can not follow you here. Compound code part is unchanged >>> and follow the original logical. So would you like to pose a new code to >>> see if its works? >> No there are significant changes as you reordered all of the >> operations. Prior to

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-12 Thread Alex Shi
在 2020/8/11 下午10:47, Alexander Duyck 写道: > On Tue, Aug 11, 2020 at 1:23 AM Alex Shi wrote: >> >> >> >> 在 2020/8/10 下午10:41, Alexander Duyck 写道: >>> On Mon, Aug 10, 2020 at 6:10 AM Alex Shi wrote: 在 2020/8/7 下午10:51, Alexander Duyck 写道: > I wonder if this entire section

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-11 Thread Alexander Duyck
On Tue, Aug 11, 2020 at 1:23 AM Alex Shi wrote: > > > > 在 2020/8/10 下午10:41, Alexander Duyck 写道: > > On Mon, Aug 10, 2020 at 6:10 AM Alex Shi wrote: > >> > >> > >> > >> 在 2020/8/7 下午10:51, Alexander Duyck 写道: > >>> I wonder if this entire section shouldn't be restructured. This is the > >>> only

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-11 Thread Alex Shi
在 2020/8/10 下午10:41, Alexander Duyck 写道: > On Mon, Aug 10, 2020 at 6:10 AM Alex Shi wrote: >> >> >> >> 在 2020/8/7 下午10:51, Alexander Duyck 写道: >>> I wonder if this entire section shouldn't be restructured. This is the >>> only spot I can see where we are resetting the LRU flag instead of >>>

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-10 Thread Alexander Duyck
On Mon, Aug 10, 2020 at 6:10 AM Alex Shi wrote: > > > > 在 2020/8/7 下午10:51, Alexander Duyck 写道: > > I wonder if this entire section shouldn't be restructured. This is the > > only spot I can see where we are resetting the LRU flag instead of > > pulling the page from the LRU list with the lock

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-10 Thread Alex Shi
在 2020/8/7 下午10:51, Alexander Duyck 写道: > I wonder if this entire section shouldn't be restructured. This is the > only spot I can see where we are resetting the LRU flag instead of > pulling the page from the LRU list with the lock held. Looking over > the code it seems like something like

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-07 Thread Alexander Duyck
On Thu, Aug 6, 2020 at 8:25 PM Alex Shi wrote: > > > > 在 2020/8/7 上午2:38, Alexander Duyck 写道: > >> + > >> isolate_abort: > >> if (locked) > >> spin_unlock_irqrestore(>lru_lock, flags); > >> + if (page) { > >> + SetPageLRU(page); > >> +

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-06 Thread Alex Shi
在 2020/8/7 上午2:38, Alexander Duyck 写道: >> + >> isolate_abort: >> if (locked) >> spin_unlock_irqrestore(>lru_lock, flags); >> + if (page) { >> + SetPageLRU(page); >> + put_page(page); >> + } >> >> /* >> * Updated

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-06 Thread Alexander Duyck
On Sat, Jul 25, 2020 at 6:00 AM Alex Shi wrote: > > Currently, compaction would get the lru_lock and then do page isolation > which works fine with pgdat->lru_lock, since any page isoltion would > compete for the lru_lock. If we want to change to memcg lru_lock, we > have to isolate the page

Re: [PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-08-04 Thread Alexander Duyck
On Sat, Jul 25, 2020 at 6:00 AM Alex Shi wrote: > > Currently, compaction would get the lru_lock and then do page isolation > which works fine with pgdat->lru_lock, since any page isoltion would > compete for the lru_lock. If we want to change to memcg lru_lock, we > have to isolate the page

[PATCH v17 14/21] mm/compaction: do page isolation first in compaction

2020-07-25 Thread Alex Shi
Currently, compaction would get the lru_lock and then do page isolation which works fine with pgdat->lru_lock, since any page isoltion would compete for the lru_lock. If we want to change to memcg lru_lock, we have to isolate the page before getting lru_lock, thus isoltion would block page's memcg