Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-06 Thread Kirill Tkhai
On 05.08.2018 15:50, Matthew Wilcox wrote: > On Sun, Aug 05, 2018 at 08:30:43AM +0300, Kirill Tkhai wrote: >> On 05.08.2018 03:03, Matthew Wilcox wrote: >>> On Sat, Aug 04, 2018 at 09:42:05PM +0300, Kirill Tkhai wrote: This is exactly the thing the patch makes. Instead of inserting a shrinker

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-05 Thread Matthew Wilcox
On Sun, Aug 05, 2018 at 08:30:43AM +0300, Kirill Tkhai wrote: > On 05.08.2018 03:03, Matthew Wilcox wrote: > > On Sat, Aug 04, 2018 at 09:42:05PM +0300, Kirill Tkhai wrote: > >> This is exactly the thing the patch makes. Instead of inserting a shrinker > >> pointer > >> to idr, it inserts a fake v

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-04 Thread Kirill Tkhai
On 05.08.2018 03:03, Matthew Wilcox wrote: > On Sat, Aug 04, 2018 at 09:42:05PM +0300, Kirill Tkhai wrote: >> This is exactly the thing the patch makes. Instead of inserting a shrinker >> pointer >> to idr, it inserts a fake value SHRINKER_REGISTERING there. The patch makes >> impossible >> to de

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-04 Thread Matthew Wilcox
On Sat, Aug 04, 2018 at 09:42:05PM +0300, Kirill Tkhai wrote: > This is exactly the thing the patch makes. Instead of inserting a shrinker > pointer > to idr, it inserts a fake value SHRINKER_REGISTERING there. The patch makes > impossible > to dereference a shrinker unless it's completely regist

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-04 Thread Kirill Tkhai
On 04.08.2018 01:51, Andrew Morton wrote: > On Fri, 03 Aug 2018 18:36:14 +0300 Kirill Tkhai wrote: > >> The patch introduces a special value SHRINKER_REGISTERING to use instead >> of list_empty() to detect a semi-registered shrinker. >> >> This should be clearer for a reader since "list is empty"

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-03 Thread Matthew Wilcox
On Fri, Aug 03, 2018 at 03:51:20PM -0700, Andrew Morton wrote: > On Fri, 03 Aug 2018 18:36:14 +0300 Kirill Tkhai wrote: > > The patch introduces a special value SHRINKER_REGISTERING to use instead > > of list_empty() to detect a semi-registered shrinker. > > All this isn't terribly nice. Why can

Re: [PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-03 Thread Andrew Morton
On Fri, 03 Aug 2018 18:36:14 +0300 Kirill Tkhai wrote: > The patch introduces a special value SHRINKER_REGISTERING to use instead > of list_empty() to detect a semi-registered shrinker. > > This should be clearer for a reader since "list is empty" is not > an intuitive state of a shrinker), and

[PATCH] mm: Use special value SHRINKER_REGISTERING instead list_empty() check

2018-08-03 Thread Kirill Tkhai
The patch introduces a special value SHRINKER_REGISTERING to use instead of list_empty() to detect a semi-registered shrinker. This should be clearer for a reader since "list is empty" is not an intuitive state of a shrinker), and this gives a better assembler code: Before: callq mov%rax,%