Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1653497

Re: Yes, people use FOLL_FORCE ;)

From Keno Fischer <keno@juliacomputing.com>
Newsgroups linux.kernel
Subject Re: Yes, people use FOLL_FORCE ;)
Date 2017-05-30 21:00 +0200
Message-ID <tMUx3-2xi-13@gated-at.bofh.it> (permalink)
References <tMBXr-72G-1@gated-at.bofh.it> <tMG14-1tZ-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hi Linus,

>      But it sounds like your JIT case actually uses it for writing -
> but if you can write a small blurb about it, that would be nice.

yes, we use it for writing. Happy to describe the scheme in more detail.

>  (b) it would probably be nice to limit FOLL_FORCE in general as much
> as possible, so if your case is about writing to your very _own_
> memory mapping, as opposed to writing to another process' memory,
> maybe we can do something like
>
>         if (mm == current->mm)
>                 flags |= FOLL_FORCE;
>
> which at least avoids the whole "let's change the VM in odd ways for a
> process that isn't even me".

While this would fix our current use case, we do have a use case for modifying
non-local address space as well (putting the JIT into a different
process). Similarly,
the rr use case precisely uses the remote mm case. I think in general
this feature
is very useful for anybody who needs to precisely control the execution of some
other process. Various debuggers (gdb/lldb/rr) certainly fall into
that category, but
there's another class of such processes (wine, various emulators) which may want
to do that kind of thing. Now, I suspect most of these will have the
other process
under ptrace control, so maybe allowing (same_mm || ptraced) would be ok, but
at least for the sandbox/remote-jit use case, it would be perfectly
reasonable to not
have the jit server be a ptracer.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Yes, people use FOLL_FORCE ;) Keno Fischer <keno@juliacomputing.com> - 2017-05-30 01:10 +0200
  Re: Yes, people use FOLL_FORCE ;) "Robert O'Callahan" <robert@ocallahan.org> - 2017-05-30 02:30 +0200
  Re: Yes, people use FOLL_FORCE ;) Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-30 05:30 +0200
    Re: Yes, people use FOLL_FORCE ;) Keno Fischer <keno@juliacomputing.com> - 2017-05-30 21:00 +0200
      Re: Yes, people use FOLL_FORCE ;) Linus Torvalds <torvalds@linux-foundation.org> - 2017-05-30 21:50 +0200

csiph-web