linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update)
@ 2016-06-22 15:05 zhong jiang
  2016-06-23  9:29 ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: zhong jiang @ 2016-06-22 15:05 UTC (permalink / raw)
  To: aneesh.kumar; +Cc: Linux Memory Management List

Hi  Aneesh

                CPU0                            CPU1
    shrink_page_list()
      add_to_swap()
        split_huge_page_to_list()
          __split_huge_pmd_locked()
            pmdp_huge_clear_flush_notify()
        // pmd_none() == true
                                        exit_mmap()
                                          unmap_vmas()
                                            zap_pmd_range()
                                              // no action on pmd since pmd_none() == true
        pmd_populate()


the mm should be the last user  when CPU1 process is exiting,  CPU0 must be a own mm .
two different process  should not be influenced each other.  in a words , they should not
have race.

I want to know if I missing the point.

Thanks
zhongjiang

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update)
  2016-06-22 15:05 A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update) zhong jiang
@ 2016-06-23  9:29 ` Michal Hocko
  2016-06-23  9:34   ` Michal Hocko
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Hocko @ 2016-06-23  9:29 UTC (permalink / raw)
  To: zhong jiang; +Cc: aneesh.kumar, Linux Memory Management List

On Wed 22-06-16 23:05:24, zhong jiang wrote:
> Hi  Aneesh
> 
>                 CPU0                            CPU1
>     shrink_page_list()
>       add_to_swap()
>         split_huge_page_to_list()
>           __split_huge_pmd_locked()
>             pmdp_huge_clear_flush_notify()
>         // pmd_none() == true
>                                         exit_mmap()
>                                           unmap_vmas()
>                                             zap_pmd_range()
>                                               // no action on pmd since pmd_none() == true
>         pmd_populate()
> 
> 
> the mm should be the last user  when CPU1 process is exiting,  CPU0 must be a own mm .
> two different process  should not be influenced each other.  in a words , they should not
> have race.

No this is a different scenario than
http://lkml.kernel.org/r/1466517956-13875-1-git-send-email-zhongjiang@huawei.com
we were discussing recently. Note that pages are still on the LRU lists
while the mm which maps them is exiting. So the above race is very much
possible.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update)
  2016-06-23  9:29 ` Michal Hocko
@ 2016-06-23  9:34   ` Michal Hocko
  2016-06-28  2:35     ` zhong jiang
  0 siblings, 1 reply; 4+ messages in thread
From: Michal Hocko @ 2016-06-23  9:34 UTC (permalink / raw)
  To: zhong jiang; +Cc: aneesh.kumar, Linux Memory Management List

On Thu 23-06-16 11:29:46, Michal Hocko wrote:
> On Wed 22-06-16 23:05:24, zhong jiang wrote:
> > Hi  Aneesh
> > 
> >                 CPU0                            CPU1
> >     shrink_page_list()
> >       add_to_swap()
> >         split_huge_page_to_list()
> >           __split_huge_pmd_locked()
> >             pmdp_huge_clear_flush_notify()
> >         // pmd_none() == true
> >                                         exit_mmap()
> >                                           unmap_vmas()
> >                                             zap_pmd_range()
> >                                               // no action on pmd since pmd_none() == true
> >         pmd_populate()
> > 
> > 
> > the mm should be the last user  when CPU1 process is exiting,  CPU0 must be a own mm .
> > two different process  should not be influenced each other.  in a words , they should not
> > have race.
> 
> No this is a different scenario than
> http://lkml.kernel.org/r/1466517956-13875-1-git-send-email-zhongjiang@huawei.com
> we were discussing recently. Note that pages are still on the LRU lists
> while the mm which maps them is exiting. So the above race is very much
> possible.

And just to clarify, I haven't checked the current code after c777e2a8b654
("powerpc/mm: Fix Multi hit ERAT cause by recent THP update") which is
ppc specific and I have no idea whether other arches need a similar
treatment. I was merely trying to explain that the mm exclusive argument
doesn't apply to reclaim vs. exit races.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update)
  2016-06-23  9:34   ` Michal Hocko
@ 2016-06-28  2:35     ` zhong jiang
  0 siblings, 0 replies; 4+ messages in thread
From: zhong jiang @ 2016-06-28  2:35 UTC (permalink / raw)
  To: Michal Hocko; +Cc: aneesh.kumar, Linux Memory Management List

On 2016/6/23 17:34, Michal Hocko wrote:
> On Thu 23-06-16 11:29:46, Michal Hocko wrote:
>> On Wed 22-06-16 23:05:24, zhong jiang wrote:
>>> Hi  Aneesh
>>>
>>>                 CPU0                            CPU1
>>>     shrink_page_list()
>>>       add_to_swap()
>>>         split_huge_page_to_list()
>>>           __split_huge_pmd_locked()
>>>             pmdp_huge_clear_flush_notify()
>>>         // pmd_none() == true
>>>                                         exit_mmap()
>>>                                           unmap_vmas()
>>>                                             zap_pmd_range()
>>>                                               // no action on pmd since pmd_none() == true
>>>         pmd_populate()
>>>
>>>
>>> the mm should be the last user  when CPU1 process is exiting,  CPU0 must be a own mm .
>>> two different process  should not be influenced each other.  in a words , they should not
>>> have race.
>> No this is a different scenario than
>> http://lkml.kernel.org/r/1466517956-13875-1-git-send-email-zhongjiang@huawei.com
>> we were discussing recently. Note that pages are still on the LRU lists
>> while the mm which maps them is exiting. So the above race is very much
>> possible.
> And just to clarify, I haven't checked the current code after c777e2a8b654
> ("powerpc/mm: Fix Multi hit ERAT cause by recent THP update") which is
> ppc specific and I have no idea whether other arches need a similar
> treatment. I was merely trying to explain that the mm exclusive argument
> doesn't apply to reclaim vs. exit races.
  Thank for your explaintion!

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-06-28  2:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-22 15:05 A question about the patch(commit :c777e2a8b654 powerpc/mm: Fix Multi hit ERAT cause by recent THP update) zhong jiang
2016-06-23  9:29 ` Michal Hocko
2016-06-23  9:34   ` Michal Hocko
2016-06-28  2:35     ` zhong jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox