From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59147C47258 for ; Thu, 25 Jan 2024 16:13:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E08D68D0003; Thu, 25 Jan 2024 11:13:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB8D68D0002; Thu, 25 Jan 2024 11:13:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C80B68D0003; Thu, 25 Jan 2024 11:13:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id B81D28D0002 for ; Thu, 25 Jan 2024 11:13:42 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 382BE16087A for ; Thu, 25 Jan 2024 16:13:42 +0000 (UTC) X-FDA: 81718329084.02.8054E2F Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by imf28.hostedemail.com (Postfix) with ESMTP id 39371C0017 for ; Thu, 25 Jan 2024 16:13:40 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=c2tQesQY; spf=pass (imf28.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.52 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706199220; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=HAkOTZIz5lxs8HKEuq4313296H/ZzDgpO7vgoAQKpT4=; b=kTtYazjVZpULxmCnUctIYRFkNFVAlMD4Qiyx2XCwkSbqWXYbscf6CQTQ6HPANfO4+NqO5+ gTwNKcXiVInyb1mMLwjmnnrX5+y6M1EEcRHk7o/feI1A+7/azDmCZY8S6Fwor4JvFkALR0 dSOObD+f6ot4pYXrPp20RHZisNqKrmM= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706199220; a=rsa-sha256; cv=none; b=Y52nmBfndcRgERvSoDgM+AbLbsMlpYajAf+Iz3Q6fStBeKvq8GB3YJoLnUHW4CIDR6WK3J Zzu1RiO1zm9Q0BIeIG/ONaqaPOVA2MGV2zuEr//Nu+RxMpI14BMNpe9TyO3POzRDGryePD GV9USTGo7GEkrIgG8IHkMLX4lV+QGYg= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=c2tQesQY; spf=pass (imf28.hostedemail.com: domain of axboe@kernel.dk designates 209.85.166.52 as permitted sender) smtp.mailfrom=axboe@kernel.dk; dmarc=none Received: by mail-io1-f52.google.com with SMTP id ca18e2360f4ac-7bee9f626caso94429439f.0 for ; Thu, 25 Jan 2024 08:13:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1706199219; x=1706804019; darn=kvack.org; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id:from:to :cc:subject:date:message-id:reply-to; bh=HAkOTZIz5lxs8HKEuq4313296H/ZzDgpO7vgoAQKpT4=; b=c2tQesQYWzsUaR7eLckVrJw+zCI3FeQA9nSRzO5Md8VGx4eN7e0as4Oq/FNTQkLfg1 uXbsv65tv+t2fs5dWGnk0iZ2AZNUkhCt4mkwLW0js6LCjh8RCp3qdC8H6SK0IQ0MToWC oI+aQsK4Epq2VAp7jfnva/dE/vNeARz4++0y/NAQU4OosAEkru0NWzJZ+ipiQ5tXnSMV 3thPz3RpqfS2wVmbRg21dLqSKhLRDZ3APTH6fEdy1a2GgjtkYaYV7omyXvxr2CLf765I rRvfiyN7DCZVf10DO4rrJCMp77fGQKAzIkJOKrCJqDWH3lS5Lr4bgEqzoT0uNXXdtaLi Z4zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706199219; x=1706804019; h=content-transfer-encoding:in-reply-to:content-language:references :cc:to:subject:from:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HAkOTZIz5lxs8HKEuq4313296H/ZzDgpO7vgoAQKpT4=; b=F5qASXrwTQ3OpO+3f71VbIMVpgOasSzg4Qtx/RSP7tg08+oQ8EIvBrawAUblGpENrN EkAilJDshkHF45JeIaXvZD8XlWz9nj8FxSYmYhmSSUwrUcWoT3BHlx1jKBXl3lCox+cu elb/ly8MPXRDoOMH2h8pexF88V034tg+0SeZbYbVY2inzzBmlCmCUs0NT+a8IFQrb8j0 Wcwgo3KOqMiaskdgPE59hwN+Ok1jad38jSq29e0cZNGGepsyiNord/IH3hWClrUg+2F3 qrUUbcHS0Tm7bp/DugDTPZ98q4zACoxmBnAdTjycZmSVYmLy12kfXB3sKB7v30KgWGXW gJxw== X-Forwarded-Encrypted: i=0; AJvYcCWVcqeOQ5NOCg2gEmoOdbw/+gEmljqn857UFOA+AxPkEg6galBOgiZr56kzGSgx9XfWnICBhO57mjm8THt+AszV4EU= X-Gm-Message-State: AOJu0YzYr0XzNsWnZ1iJ1aRlXfk6jjFgurPGsKbelyNe60AC4jAsKFrJ 2By0Ps1oIR1r4kXajQZ30Fy2cHz4vZ98FxxwSMQqKfkhTVvgnIB60zEGknNVSdQ= X-Google-Smtp-Source: AGHT+IGxmHdLcWxr2mQPouIDjWNx7Kev4k3u8IORuaWbpZv1GYb8yieuqEh/afnZO7lUdPnu5h+QoQ== X-Received: by 2002:a5e:d714:0:b0:7bf:b770:d4ed with SMTP id v20-20020a5ed714000000b007bfb770d4edmr10280iom.0.1706199219230; Thu, 25 Jan 2024 08:13:39 -0800 (PST) Received: from [192.168.1.116] ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id y13-20020a5ec80d000000b007bf4f95cf85sm5785870iol.37.2024.01.25.08.13.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Jan 2024 08:13:38 -0800 (PST) Message-ID: <6c4a4cf3-c5ed-4236-a6b2-9d53e927f979@kernel.dk> Date: Thu, 25 Jan 2024 09:13:37 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Jens Axboe Subject: Re: [PATCH, RFC] block: set noio context in submit_bio_noacct_nocheck To: Matthew Wilcox Cc: Christoph Hellwig , linux-block@vger.kernel.org, tj@kernel.org, jiangshanlai@gmail.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org References: <20240124093941.2259199-1-hch@lst.de> <20240125081050.GA21006@lst.de> <07de550c-2048-4b2f-8127-e20de352ffde@kernel.dk> Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 39371C0017 X-Rspam-User: X-Stat-Signature: ncjke36qccw8hacgxowkdiqgwmfpfre5 X-Rspamd-Server: rspam03 X-HE-Tag: 1706199220-161438 X-HE-Meta: U2FsdGVkX1/WZFiN8gMnYN477s0N98Ib3BReDe4Z8gJdouvD1fF4FH/f9Ic4R4GD0dT0m4GF2GBoOLIMJ1lr3XN/Ja3pApN0E/8R2pnCK83DcI+O12vYVwBrL7dm1CgbyGVpqRHsoxgUMZ1dloVlgJGjOnREPYeFfL5Q17/umCKL00tbjhv/2aDKdBM+XKl9XLaCXD7LWg57bCASqtumHSGpXN97wJa8PEgqPtqMkYleRxmqWt6K4yE1PB2VP4lWIFIHvuQcsLsW5B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3mmcFLwB6PQKRV4l3QHG5MiWxNKRMEbZ8+Q4QV7RBeSjj8vE2Sg40yFB1RPkSdTbLh+ypQIf8J/iJrg5u9XfksFuaul31oSVs+WEby7L1ei+9c5d5Xkjo1iP8VU/NfIceGlPfS9bAToBDSxXiQtoQvlZVW9USi7B6VE+rdOmYxnMClwqLw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, Jan 25, 2024 at 9:11?AM Matthew Wilcox 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