lkml.org 
[lkml]   [2019]   [Nov]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: possible deadlock in mon_bin_vma_fault
    On Wed, 20 Nov 2019 13:47:00 -0500 (EST)
    Alan Stern <stern@rowland.harvard.edu> wrote:

    > > + if (rp->mmap_active)
    > > + return -EBUSY;

    > Like that, yes, but the test has to be made while fetch_lock is held.

    Certainly, thanks. I was rushing just to add a postscriptum.

    > Incidentally, the comment for fetch_lock says that it protects b_read
    > and b_out, but mon_bin_vma_fault doesn't use either of those fields.

    I probably should change that comment to "protect the integrity of the
    circular buffer, such as b_out".

    Anyway... If you are looking at it too, what do you think about not using
    any locks in mon_bin_vma_fault() at all? Isn't it valid? I think I tried
    to be "safe", but it only uses things that are constants unless we're
    opening and closing; a process cannot make page faults unless it has
    some thing mapped; and that is only possible if device is open and stays
    open. Can you find a hole in this reasoning?

    -- Pete

    \
     
     \ /
      Last update: 2019-11-21 15:49    [W:9.006 / U:0.436 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site