linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
       [not found] ` <be690355-03c6-42e2-a13f-b593ad1c0edd@kernel.dk>
@ 2024-01-25  8:10   ` Christoph Hellwig
  2024-01-25 16:09     ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2024-01-25  8:10 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Christoph Hellwig, linux-block, tj, jiangshanlai, linux-kernel, linux-mm

On Wed, Jan 24, 2024 at 08:40:28AM -0700, Jens Axboe wrote:
> On 1/24/24 2:39 AM, Christoph Hellwig wrote:
> > Make sure all in-line block layer submission runs in noio reclaim
> > context.  This is a big step towards allowing GFP_NOIO, the other
> > one would be to have noio (and nofs for that matter) workqueues for
> > kblockd and driver internal workqueues.
> 
> I really don't like adding this for no good reason. Who's doing non NOIO
> allocations down from this path?

If there is a non-NOIO allocation right now that would be a bug,
although I would not be surprised if we had a few of them.

The reason to add this is a different one:  The MM folks want to
get rid of GFP_NOIO and GFP_NOFS and replace them by these context.

And doing this in the submission path and kblockd will cover almost
all of the noio context, with the rest probably covered by other
workqueues.  And this feels a lot less error prone than requiring
every driver to annotate the context in their submission routines.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
  2024-01-25  8:10   ` [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck Christoph Hellwig
@ 2024-01-25 16:09     ` Jens Axboe
  2024-01-25 16:11       ` Matthew Wilcox
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2024-01-25 16:09 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: linux-block, tj, jiangshanlai, linux-kernel, linux-mm

On 1/25/24 1:10 AM, Christoph Hellwig wrote:
> On Wed, Jan 24, 2024 at 08:40:28AM -0700, Jens Axboe wrote:
>> On 1/24/24 2:39 AM, Christoph Hellwig wrote:
>>> Make sure all in-line block layer submission runs in noio reclaim
>>> context.  This is a big step towards allowing GFP_NOIO, the other
>>> one would be to have noio (and nofs for that matter) workqueues for
>>> kblockd and driver internal workqueues.
>>
>> I really don't like adding this for no good reason. Who's doing non NOIO
>> allocations down from this path?
> 
> If there is a non-NOIO allocation right now that would be a bug,
> although I would not be surprised if we had a few of them.
> 
> The reason to add this is a different one:  The MM folks want to
> get rid of GFP_NOIO and GFP_NOFS and replace them by these context.
> 
> And doing this in the submission path and kblockd will cover almost
> all of the noio context, with the rest probably covered by other
> workqueues.  And this feels a lot less error prone than requiring
> every driver to annotate the context in their submission routines.

I think it'd be much better to add a DEBUG protected aid that checks for
violating allocations. Nothing that isn't buggy should trigger this,
right now, and then we could catch problems if there are any. If we do
the save/restore there and call it good, then we're going to be stuck
with that forever. Regardless of whether it's actually needed or not.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
  2024-01-25 16:09     ` Jens Axboe
@ 2024-01-25 16:11       ` Matthew Wilcox
  2024-01-25 16:13         ` Jens Axboe
  0 siblings, 1 reply; 5+ messages in thread
From: Matthew Wilcox @ 2024-01-25 16:11 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Christoph Hellwig, linux-block, tj, jiangshanlai, linux-kernel, linux-mm

On Thu, Jan 25, 2024 at 09:09:44AM -0700, Jens Axboe wrote:
> On 1/25/24 1:10 AM, Christoph Hellwig wrote:
> > On Wed, Jan 24, 2024 at 08:40:28AM -0700, Jens Axboe wrote:
> >> On 1/24/24 2:39 AM, Christoph Hellwig wrote:
> >>> Make sure all in-line block layer submission runs in noio reclaim
> >>> context.  This is a big step towards allowing GFP_NOIO, the other
> >>> one would be to have noio (and nofs for that matter) workqueues for
> >>> kblockd and driver internal workqueues.
> >>
> >> I really don't like adding this for no good reason. Who's doing non NOIO
> >> allocations down from this path?
> > 
> > If there is a non-NOIO allocation right now that would be a bug,
> > although I would not be surprised if we had a few of them.
> > 
> > The reason to add this is a different one:  The MM folks want to
> > get rid of GFP_NOIO and GFP_NOFS and replace them by these context.
> > 
> > And doing this in the submission path and kblockd will cover almost
> > all of the noio context, with the rest probably covered by other
> > workqueues.  And this feels a lot less error prone than requiring
> > every driver to annotate the context in their submission routines.
> 
> I think it'd be much better to add a DEBUG protected aid that checks for
> violating allocations. Nothing that isn't buggy should trigger this,
> right now, and then we could catch problems if there are any. If we do
> the save/restore there and call it good, then we're going to be stuck
> with that forever. Regardless of whether it's actually needed or not.

Nono, you don't understand.  The plan is to remove GFP_NOIO
entirely.  Allocations should be done with GFP_KERNEL while under a
memalloc_noio_save().


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
  2024-01-25 16:11       ` Matthew Wilcox
@ 2024-01-25 16:13         ` Jens Axboe
  2024-01-26 13:52           ` Christoph Hellwig
  0 siblings, 1 reply; 5+ messages in thread
From: Jens Axboe @ 2024-01-25 16:13 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: Christoph Hellwig, linux-block, tj, jiangshanlai, linux-kernel, linux-mm

On Thu, Jan 25, 2024 at 9:11?AM Matthew Wilcox <willy@infradead.org> wrote:
>
> On Thu, Jan 25, 2024 at 09:09:44AM -0700, Jens Axboe wrote:
> > On 1/25/24 1:10 AM, Christoph Hellwig wrote:
> > > On Wed, Jan 24, 2024 at 08:40:28AM -0700, Jens Axboe wrote:
> > >> On 1/24/24 2:39 AM, Christoph Hellwig wrote:
> > >>> Make sure all in-line block layer submission runs in noio reclaim
> > >>> context.  This is a big step towards allowing GFP_NOIO, the other
> > >>> one would be to have noio (and nofs for that matter) workqueues for
> > >>> kblockd and driver internal workqueues.
> > >>
> > >> I really don't like adding this for no good reason. Who's doing non NOIO
> > >> allocations down from this path?
> > >
> > > If there is a non-NOIO allocation right now that would be a bug,
> > > although I would not be surprised if we had a few of them.
> > >
> > > The reason to add this is a different one:  The MM folks want to
> > > get rid of GFP_NOIO and GFP_NOFS and replace them by these context.
> > >
> > > And doing this in the submission path and kblockd will cover almost
> > > all of the noio context, with the rest probably covered by other
> > > workqueues.  And this feels a lot less error prone than requiring
> > > every driver to annotate the context in their submission routines.
> >
> > I think it'd be much better to add a DEBUG protected aid that checks for
> > violating allocations. Nothing that isn't buggy should trigger this,
> > right now, and then we could catch problems if there are any. If we do
> > the save/restore there and call it good, then we're going to be stuck
> > with that forever. Regardless of whether it's actually needed or not.
>
> Nono, you don't understand.  The plan is to remove GFP_NOIO
> entirely.  Allocations should be done with GFP_KERNEL while under a
> memalloc_noio_save().

I do understand, but thanks for the vote of confidence. Place the
save/restore higher up, most likely actual IO submission isn't going to
be the only (or even major) allocation potentially needed for the IO.

-- 
Jens Axboe



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck
  2024-01-25 16:13         ` Jens Axboe
@ 2024-01-26 13:52           ` Christoph Hellwig
  0 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2024-01-26 13:52 UTC (permalink / raw)
  To: Jens Axboe
  Cc: Matthew Wilcox, Christoph Hellwig, linux-block, tj, jiangshanlai,
	linux-kernel, linux-mm

On Thu, Jan 25, 2024 at 09:13:37AM -0700, Jens Axboe wrote:
> > Nono, you don't understand.  The plan is to remove GFP_NOIO
> > entirely.  Allocations should be done with GFP_KERNEL while under a
> > memalloc_noio_save().
> 
> I do understand, but thanks for the vote of confidence. Place the
> save/restore higher up, most likely actual IO submission isn't going to
> be the only (or even major) allocation potentially needed for the IO.

NOIO is defined as allocations that will not recurse into the I/O stack.
So for anything block based, entering the block layer is literally
the defined boundary where it should be used below.  So no, wrapping
every submit_bio into a context annotation doesn't make much sense.



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-01-26 13:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20240124093941.2259199-1-hch@lst.de>
     [not found] ` <be690355-03c6-42e2-a13f-b593ad1c0edd@kernel.dk>
2024-01-25  8:10   ` [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck Christoph Hellwig
2024-01-25 16:09     ` Jens Axboe
2024-01-25 16:11       ` Matthew Wilcox
2024-01-25 16:13         ` Jens Axboe
2024-01-26 13:52           ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox