lkml.org 
[lkml]   [2021]   [Feb]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 34/33] netfs: Use in_interrupt() not in_softirq()
Date
Christoph Hellwig <hch@lst.de> wrote:

> On Mon, Feb 15, 2021 at 10:46:23PM +0000, David Howells wrote:
> > The in_softirq() in netfs_rreq_terminated() works fine for the cache being
> > on a normal disk, as the completion handlers may get called in softirq
> > context, but for an NVMe drive, the completion handler may get called in
> > IRQ context.
> >
> > Fix to use in_interrupt() instead of in_softirq() throughout the read
> > helpers, particularly when deciding whether to punt code that might sleep
> > off to a worker thread.
>
> We must not use either check, as they all are unreliable especially
> for PREEMPT-RT.

Is there a better way to do it? The intent is to process the assessment phase
in the calling thread's context if possible rather than bumping over to a
worker thread. For synchronous I/O, for example, that's done in the caller's
thread. Maybe that's the answer - if it's known to be asynchronous, I have to
punt, but otherwise don't have to.

David

\
 
 \ /
  Last update: 2021-02-17 11:36    [W:0.292 / U:22.948 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site