linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Query on shrink list
@ 2018-08-17 10:09 Mukesh Ojha
  2018-08-17 12:58 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Mukesh Ojha @ 2018-08-17 10:09 UTC (permalink / raw)
  To: Al Viro, linux-fsdevel, lkml

Hi Al Viro,

Is there is reason we have kept data->found++, if the dentry already 
there in shrink list ?

static enum d_walk_ret select_collect(
...
         if (dentry->d_flags & DCACHE_SHRINK_LIST) {
                 data->found++;
         } else {
   ..

If the dentry is already there on shrink list, does it not mean that 
data->found is already non-zero ?
Can't we just go out from here directly?


Regards,
Mukesh

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

* Re: Query on shrink list
  2018-08-17 10:09 Query on shrink list Mukesh Ojha
@ 2018-08-17 12:58 ` Al Viro
  2018-08-17 14:37   ` Mukesh Ojha
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2018-08-17 12:58 UTC (permalink / raw)
  To: Mukesh Ojha; +Cc: linux-fsdevel, lkml

On Fri, Aug 17, 2018 at 03:39:22PM +0530, Mukesh Ojha wrote:
> Hi Al Viro,
> 
> Is there is reason we have kept data->found++, if the dentry already there
> in shrink list ?
> 
> static enum d_walk_ret select_collect(
> ...
> ������� if (dentry->d_flags & DCACHE_SHRINK_LIST) {
> ��������������� data->found++;
> ������� } else {
> � ..
> 
> If the dentry is already there on shrink list, does it not mean that
> data->found is already non-zero ?

Nope.  It can be on *another* shrink list - if two processes are doing
that...

> Can't we just go out from here directly?

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

* Re: Query on shrink list
  2018-08-17 12:58 ` Al Viro
@ 2018-08-17 14:37   ` Mukesh Ojha
  0 siblings, 0 replies; 3+ messages in thread
From: Mukesh Ojha @ 2018-08-17 14:37 UTC (permalink / raw)
  To: Al Viro; +Cc: linux-fsdevel, lkml



On 8/17/2018 6:28 PM, Al Viro wrote:
> On Fri, Aug 17, 2018 at 03:39:22PM +0530, Mukesh Ojha wrote:
>> Hi Al Viro,
>>
>> Is there is reason we have kept data->found++, if the dentry already there
>> in shrink list ?
>>
>> static enum d_walk_ret select_collect(
>> ...
>>          if (dentry->d_flags & DCACHE_SHRINK_LIST) {
>>                  data->found++;
>>          } else {
>>    ..
>>
>> If the dentry is already there on shrink list, does it not mean that
>> data->found is already non-zero ?
> Nope.  It can be on *another* shrink list - if two processes are doing
> that...

Ok, if we go out simply,  letting others to do the job will break 
`shrink_dcache_parent()`
and if someone touched that dentry made the refcount > 0 while it is on 
shrink list
  then owner will keep on looping in shrink_dentry_list() until refcount 
becomes 0 .

Am i making sense here ?

Thanks.
Mukesh

>
>> Can't we just go out from here directly?

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

end of thread, other threads:[~2018-08-17 16:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-17 10:09 Query on shrink list Mukesh Ojha
2018-08-17 12:58 ` Al Viro
2018-08-17 14:37   ` Mukesh Ojha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).