lkml.org 
[lkml]   [2012]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 0/5] seqlock consolidation
On Thu, Mar 15, 2012 at 08:17:12PM +0100, Thomas Gleixner wrote:
> > + hits += replace_path(&fs->root, old_root, new_root);
> > + hits += replace_path(&fs->pwd, old_root, new_root);
>
> Wouldn't it be simpler to just do:
>
> + count += replace_path(&fs->root, old_root, new_root);
> + count += replace_path(&fs->pwd, old_root, new_root);
>
> > + write_seqcount_end(&fs->seq);
> > + while (hits--) {
> > count++;
>
> Instead of that loop ?

This loop also contains path_get_longterm() and we need to do it before
dropping fs->lock. We are holding a reference to new_root, all right,
but once it's place into ->fs->{root,pwd} of another task and ->fs->lock
is dropped, there's nothing to stop that task of doing chdir() and dropping
its reference. Which could outweight the single reference we are holding
pretty soon...


\
 
 \ /
  Last update: 2012-03-15 21:45    [W:1.580 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site