Re: 回复: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

2021-01-27 Thread Uladzislau Rezki
On Wed, Jan 27, 2021 at 09:00:27AM +, Zhang, Qiang wrote:
> 
> 
> 
> 发件人: Uladzislau Rezki 
> 发送时间: 2021年1月26日 22:07
> 收件人: Zhang, Qiang
> 抄送: Uladzislau Rezki; Paul E. McKenney; r...@vger.kernel.org; 
> linux-kernel@vger.kernel.org
> 主题: Re: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going 
> offline
> 
> >
> > On Fri, Jan 22, 2021 at 01:44:36AM +, Zhang, Qiang wrote:
> > >
> > >
> > > 
> > > 发件人: Uladzislau Rezki 
> > > 发送时间: 2021年1月22日 4:26
> > > 收件人: Zhang, Qiang
> > > 抄送: Paul E. McKenney; r...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> > > ure...@gmail.com
> > > 主题: Re: [PATCH] rcu: Release per-cpu krcp page cache when CPU going 
> > > offline
> > > >Hello, Qiang,
> > >
> > > > On Thu, Jan 21, 2021 at 02:49:49PM +0800, qiang.zh...@windriver.com 
> > > > wrote:
> > > > > From: Zqiang 
> > > > >
> > > > > If CPUs go offline, the corresponding krcp's page cache can
> > > > > not be use util the CPU come back online, or maybe the CPU
> > > > > will never go online again, this commit therefore free krcp's
> > > > > page cache when CPUs go offline.
> > > > >
> > > > > Signed-off-by: Zqiang 
> > > >
> > > >Do you consider it as an issue? We have 5 pages per CPU, that is 20480 
> > > >bytes.
> > > >
> > >
> > > Hello Rezki
> > >
> > > In a multi CPUs system, more than one CPUs may be offline, there are more 
> > > than 5 pages,  and these offline CPUs may never go online again  or  in 
> > > the process of CPUs online, there are errors, which lead to the failure 
> > > of online, these scenarios will lead to the per-cpu krc page cache will 
> > > never be released.
> > >
> > >Thanks for your answer. I was thinking more about if you knew some 
> > >>platforms
> > >which suffer from such extra page usage when CPU goes offline. Any >issues
> > >your platforms or devices run into because of that.
> > >
> > >So i understand that if CPU goes offline the 5 pages associated with it 
> > >>are
> > >unused until it goes online back.
> >
> >  I agree with you, But I still want to talk about what I think
> >
> >  My understanding is that when the CPU is offline,  the pages is not
> >  accessible,  beacuse we don't know when this CPU will
> >  go online again, so we best to return these page to the buddy system,
> >  when the CPU goes online again, we can allocate page from the buddy
> >  system to fill krcp's page cache.  maybe you may think that this memory
> >  is small and don't need to.
> >
> >BTW, we can release the caches via shrinker path instead, what is more makes
> >sense to me. We already have a callback, that frees pages when a page 
> >allocator
> >asks for it. I think in that case it would be fair to return it to the buddy
> >system. It happens under low memory condition
> 
>   I agree. it can be done in shrink callback, can release the currently 
> existing per-cpu 
>   page cache.
>   
Would not you mind to send a patch? If you need some input, i am happy
to participate.

Thanks!

--
Vlad Rezki


回复: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

2021-01-27 Thread Zhang, Qiang



发件人: Uladzislau Rezki 
发送时间: 2021年1月26日 22:07
收件人: Zhang, Qiang
抄送: Uladzislau Rezki; Paul E. McKenney; r...@vger.kernel.org; 
linux-kernel@vger.kernel.org
主题: Re: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going 
offline

>
> On Fri, Jan 22, 2021 at 01:44:36AM +, Zhang, Qiang wrote:
> >
> >
> > 
> > 发件人: Uladzislau Rezki 
> > 发送时间: 2021年1月22日 4:26
> > 收件人: Zhang, Qiang
> > 抄送: Paul E. McKenney; r...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> > ure...@gmail.com
> > 主题: Re: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline
> > >Hello, Qiang,
> >
> > > On Thu, Jan 21, 2021 at 02:49:49PM +0800, qiang.zh...@windriver.com wrote:
> > > > From: Zqiang 
> > > >
> > > > If CPUs go offline, the corresponding krcp's page cache can
> > > > not be use util the CPU come back online, or maybe the CPU
> > > > will never go online again, this commit therefore free krcp's
> > > > page cache when CPUs go offline.
> > > >
> > > > Signed-off-by: Zqiang 
> > >
> > >Do you consider it as an issue? We have 5 pages per CPU, that is 20480 
> > >bytes.
> > >
> >
> > Hello Rezki
> >
> > In a multi CPUs system, more than one CPUs may be offline, there are more 
> > than 5 pages,  and these offline CPUs may never go online again  or  in the 
> > process of CPUs online, there are errors, which lead to the failure of 
> > online, these scenarios will lead to the per-cpu krc page cache will never 
> > be released.
> >
> >Thanks for your answer. I was thinking more about if you knew some >platforms
> >which suffer from such extra page usage when CPU goes offline. Any >issues
> >your platforms or devices run into because of that.
> >
> >So i understand that if CPU goes offline the 5 pages associated with it >are
> >unused until it goes online back.
>
>  I agree with you, But I still want to talk about what I think
>
>  My understanding is that when the CPU is offline,  the pages is not
>  accessible,  beacuse we don't know when this CPU will
>  go online again, so we best to return these page to the buddy system,
>  when the CPU goes online again, we can allocate page from the buddy
>  system to fill krcp's page cache.  maybe you may think that this memory
>  is small and don't need to.
>
>BTW, we can release the caches via shrinker path instead, what is more makes
>sense to me. We already have a callback, that frees pages when a page allocator
>asks for it. I think in that case it would be fair to return it to the buddy
>system. It happens under low memory condition

  I agree. it can be done in shrink callback, can release the currently 
existing per-cpu 
  page cache.
  
   Thanks
   Qiang
> or can be done manually to flush
>system caches:
>
>echo 3 > /proc/sys/vm/drop_caches
>
>What do you think?
>
>--
>Vlad Rezki


Re: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

2021-01-26 Thread Uladzislau Rezki
> 
> 发件人: Uladzislau Rezki 
> 发送时间: 2021年1月22日 22:31
> 收件人: Zhang, Qiang
> 抄送: Uladzislau Rezki; Paul E. McKenney; r...@vger.kernel.org; 
> linux-kernel@vger.kernel.org
> 主题: Re: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going 
> offline
> 
> On Fri, Jan 22, 2021 at 01:44:36AM +, Zhang, Qiang wrote:
> >
> >
> > 
> > 发件人: Uladzislau Rezki 
> > 发送时间: 2021年1月22日 4:26
> > 收件人: Zhang, Qiang
> > 抄送: Paul E. McKenney; r...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> > ure...@gmail.com
> > 主题: Re: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline
> > >Hello, Qiang,
> >
> > > On Thu, Jan 21, 2021 at 02:49:49PM +0800, qiang.zh...@windriver.com wrote:
> > > > From: Zqiang 
> > > >
> > > > If CPUs go offline, the corresponding krcp's page cache can
> > > > not be use util the CPU come back online, or maybe the CPU
> > > > will never go online again, this commit therefore free krcp's
> > > > page cache when CPUs go offline.
> > > >
> > > > Signed-off-by: Zqiang 
> > >
> > >Do you consider it as an issue? We have 5 pages per CPU, that is 20480 
> > >bytes.
> > >
> >
> > Hello Rezki
> >
> > In a multi CPUs system, more than one CPUs may be offline, there are more 
> > than 5 pages,  and these offline CPUs may never go online again  or  in the 
> > process of CPUs online, there are errors, which lead to the failure of 
> > online, these scenarios will lead to the per-cpu krc page cache will never 
> > be released.
> >
> >Thanks for your answer. I was thinking more about if you knew some >platforms
> >which suffer from such extra page usage when CPU goes offline. Any >issues
> >your platforms or devices run into because of that.
> >
> >So i understand that if CPU goes offline the 5 pages associated with it >are
> >unused until it goes online back.
> 
>  I agree with you, But I still want to talk about what I think
> 
>  My understanding is that when the CPU is offline,  the pages is not 
>  accessible,  beacuse we don't know when this CPU will 
>  go online again, so we best to return these page to the buddy system,
>  when the CPU goes online again, we can allocate page from the buddy 
>  system to fill krcp's page cache.  maybe you may think that this memory 
>  is small and don't need to. 
>  
BTW, we can release the caches via shrinker path instead, what is more makes
sense to me. We already have a callback, that frees pages when a page allocator
asks for it. I think in that case it would be fair to return it to the buddy
system. It happens under low memory condition or can be done manually to flush
system caches:

echo 3 > /proc/sys/vm/drop_caches

What do you think?

--
Vlad Rezki


Re: 回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

2021-01-24 Thread Uladzislau Rezki
On Sun, Jan 24, 2021 at 02:21:07AM +, Zhang, Qiang wrote:
> 
> 
> 
> 发件人: Uladzislau Rezki 
> 发送时间: 2021年1月22日 22:31
> 收件人: Zhang, Qiang
> 抄送: Uladzislau Rezki; Paul E. McKenney; r...@vger.kernel.org; 
> linux-kernel@vger.kernel.org
> 主题: Re: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going 
> offline
> 
> On Fri, Jan 22, 2021 at 01:44:36AM +, Zhang, Qiang wrote:
> >
> >
> > 
> > 发件人: Uladzislau Rezki 
> > 发送时间: 2021年1月22日 4:26
> > 收件人: Zhang, Qiang
> > 抄送: Paul E. McKenney; r...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> > ure...@gmail.com
> > 主题: Re: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline
> > >Hello, Qiang,
> >
> > > On Thu, Jan 21, 2021 at 02:49:49PM +0800, qiang.zh...@windriver.com wrote:
> > > > From: Zqiang 
> > > >
> > > > If CPUs go offline, the corresponding krcp's page cache can
> > > > not be use util the CPU come back online, or maybe the CPU
> > > > will never go online again, this commit therefore free krcp's
> > > > page cache when CPUs go offline.
> > > >
> > > > Signed-off-by: Zqiang 
> > >
> > >Do you consider it as an issue? We have 5 pages per CPU, that is 20480 
> > >bytes.
> > >
> >
> > Hello Rezki
> >
> > In a multi CPUs system, more than one CPUs may be offline, there are more 
> > than 5 pages,  and these offline CPUs may never go online again  or  in the 
> > process of CPUs online, there are errors, which lead to the failure of 
> > online, these scenarios will lead to the per-cpu krc page cache will never 
> > be released.
> >
> >Thanks for your answer. I was thinking more about if you knew some >platforms
> >which suffer from such extra page usage when CPU goes offline. Any >issues
> >your platforms or devices run into because of that.
> >
> >So i understand that if CPU goes offline the 5 pages associated with it >are
> >unused until it goes online back.
> 
>  I agree with you, But I still want to talk about what I think
> 
>  My understanding is that when the CPU is offline,  the pages is not 
>  accessible,  beacuse we don't know when this CPU will 
>  go online again, so we best to return these page to the buddy system,
>  when the CPU goes online again, we can allocate page from the buddy 
>  system to fill krcp's page cache.  maybe you may think that this memory 
>  is small and don't need to. 
>  
Exactly. I think that 5 pages are not that important(small amount of memory),
so it is not worth to build the logic around it in order to return them back
to the page allocator when CPU goes offline, even forever. This is how i see it.

If you are aware about some specific systems where it is critical, please
let's as know.

--
Vlad Rezki


回复: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

2021-01-23 Thread Zhang, Qiang



发件人: Uladzislau Rezki 
发送时间: 2021年1月22日 22:31
收件人: Zhang, Qiang
抄送: Uladzislau Rezki; Paul E. McKenney; r...@vger.kernel.org; 
linux-kernel@vger.kernel.org
主题: Re: 回复: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline

On Fri, Jan 22, 2021 at 01:44:36AM +, Zhang, Qiang wrote:
>
>
> 
> 发件人: Uladzislau Rezki 
> 发送时间: 2021年1月22日 4:26
> 收件人: Zhang, Qiang
> 抄送: Paul E. McKenney; r...@vger.kernel.org; linux-kernel@vger.kernel.org; 
> ure...@gmail.com
> 主题: Re: [PATCH] rcu: Release per-cpu krcp page cache when CPU going offline
> >Hello, Qiang,
>
> > On Thu, Jan 21, 2021 at 02:49:49PM +0800, qiang.zh...@windriver.com wrote:
> > > From: Zqiang 
> > >
> > > If CPUs go offline, the corresponding krcp's page cache can
> > > not be use util the CPU come back online, or maybe the CPU
> > > will never go online again, this commit therefore free krcp's
> > > page cache when CPUs go offline.
> > >
> > > Signed-off-by: Zqiang 
> >
> >Do you consider it as an issue? We have 5 pages per CPU, that is 20480 bytes.
> >
>
> Hello Rezki
>
> In a multi CPUs system, more than one CPUs may be offline, there are more 
> than 5 pages,  and these offline CPUs may never go online again  or  in the 
> process of CPUs online, there are errors, which lead to the failure of 
> online, these scenarios will lead to the per-cpu krc page cache will never be 
> released.
>
>Thanks for your answer. I was thinking more about if you knew some >platforms
>which suffer from such extra page usage when CPU goes offline. Any >issues
>your platforms or devices run into because of that.
>
>So i understand that if CPU goes offline the 5 pages associated with it >are
>unused until it goes online back.

 I agree with you, But I still want to talk about what I think

 My understanding is that when the CPU is offline,  the pages is not 
 accessible,  beacuse we don't know when this CPU will 
 go online again, so we best to return these page to the buddy system,
 when the CPU goes online again, we can allocate page from the buddy 
 system to fill krcp's page cache.  maybe you may think that this memory 
 is small and don't need to. 
 
 Thanks 
 Qiang

>
>--
>Vlad Rezki