[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wihdDOSVVi1gBYo+rcJ7dG6tvN7mEU=XLir8WiEdR1kQQ@mail.gmail.com>
Date: Fri, 16 Sep 2022 13:09:21 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Palmer Dabbelt <palmer@...osinc.com>
Cc: linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org
Subject: Re: [GIT PULL] RISC-V Fixes for 6.0-rc6
On Fri, Sep 16, 2022 at 8:31 AM Palmer Dabbelt <palmer@...osinc.com> wrote:
>
> I have one merge conflict as a result of a treewide fix, I'm getting some odd
> output from just showing the merge (it's showing some of the fix too), but I
> think the merge itself is OK. My fix is to keep the write lock
>
> - mmap_read_lock(mm);
> ++ mmap_write_lock(mm);
> + ret = walk_page_range_novma(mm, start, end, &pageattr_ops, NULL,
> + &masks);
> - mmap_read_unlock(mm);
> ++ mmap_write_unlock(mm);
Yes, thatr's the proper merge resolution.
HOWEVER.
Looking at the *callers* of this new __set_memory_mm(), this is all
completely bogus and broken.
In particular, fix_kernel_mem_early() does that call under rcu_read_lock().
You can't do that. Not with the read-lock, and not with the
write-lock. You simply cannot (and must not) block while in a
read-side critical section, and trying to take any sleeping lock -
whether for reading or for writing - is just completely wrong.
So I'm not doing this pull. The merge resolution is trivial, but the
code is simply wrong.
Linus
Powered by blists - more mailing lists