[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150323191055.GA10212@redhat.com>
Date: Mon, 23 Mar 2015 20:10:55 +0100
From: Oleg Nesterov <oleg@...hat.com>
To: Davidlohr Bueso <dave@...olabs.net>
Cc: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: fix lockdep build in rcu-protected
get_mm_exe_file()
On 03/23, Davidlohr Bueso wrote:
>
> void set_mm_exe_file(struct mm_struct *mm, struct file *new_exe_file)
> {
> struct file *old_exe_file = rcu_dereference_protected(mm->exe_file,
> - !atomic_read(&mm->mm_users) || current->in_execve ||
> - lock_is_held(&mm->mmap_sem));
> + !atomic_read(&mm->mm_users) || current->in_execve);
Thanks, looks correct at first glance...
But can't we remove the ->in_execve check above? and check
atomic_read(&mm->mm_users) <= 1
instead. OK, this is subjective, I won't insist. Just current->in_execve
looks a bit confusing, it means "I swear, the caller is flush_old_exec()
and this mm is actualy bprm->mm".
"atomic_read(&mm->mm_users) <= 1" looks a bit more "safe". But again,
I won't insist.
Oleg.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists