[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFLxGvz2t8rnEQh4VBJ8v3b66GKA5DY3iMk33jnMP664+RMubw@mail.gmail.com>
Date: Thu, 15 Feb 2018 10:14:27 +0100
From: Richard Weinberger <richard.weinberger@...il.com>
To: Enrico Weigelt <lkml@...ux.net>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: fs_struct refcounting: spinlock vs atomic
On Wed, Feb 14, 2018 at 10:13 PM, Enrico Weigelt <lkml@...ux.net> wrote:
> Hi folks,
>
>
> in fork.c, a spinlock is held for fs_struct refcounting, while other
> places - eg. switch_task_namespaces uses atomic_dec_and_test() on
> the nsproxy.
>
> What's the exact difference here ? Could the atomic counting also used
> for fs_struct ?
Well, the spinlock protects more than just the counter. So atomic won't do it.
--
Thanks,
//richard
Powered by blists - more mailing lists