On 4/10/2020 1:03 AM, Bijan Mottahedeh wrote: > Do not clear work->mm since io_madvise() passes it to do_madvise() > when the request is actually processed. As I see, this down_read() from the trace is down_read(¤t->mm->mmap_sem), where current->mm is set by use_mm() just several lines above your change. So, what do you mean by passing? I don't see do_madvise() __explicitly__ accepting mm as an argument. What tree do you use? Extra patches on top? > > Signed-off-by: Bijan Mottahedeh <bijan.mottahedeh@xxxxxxxxxx> > --- > fs/io-wq.c | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/fs/io-wq.c b/fs/io-wq.c > index 4023c98..4d20754 100644 > --- a/fs/io-wq.c > +++ b/fs/io-wq.c > @@ -431,8 +431,6 @@ static void io_wq_switch_mm(struct io_worker *worker, struct io_wq_work *work) > if (!worker->mm) > set_fs(USER_DS); > worker->mm = work->mm; > - /* hang on to this mm */ > - work->mm = NULL; > return; > } > > -- Pavel Begunkov