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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F62AC46467 for ; Thu, 19 Jan 2023 11:35:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbjASLfm (ORCPT ); Thu, 19 Jan 2023 06:35:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231140AbjASLf2 (ORCPT ); Thu, 19 Jan 2023 06:35:28 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7A6345884 for ; Thu, 19 Jan 2023 03:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1674128072; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wENbE+nHAam7hm4getAL3jIsMYX9GXCSRwsVpNwJFgw=; b=db+R3Q+Ix8PHV+DjrNFyaf2VVxUkZMJ/6LaMmQXZCki7Q8GK5r882XlEtItyh/z7yN06Pa FGB5JVDYoL3rRLnBU5g0Ecpmj1zbE2wIqcFNCteGXZX1h5rsmjvx4HElje8ldvF2IvIxOg VIs/a08VSZjwJvRxTH61R9VAscS1ntM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-QrqReUFLP0iOyErLHa8brw-1; Thu, 19 Jan 2023 06:34:29 -0500 X-MC-Unique: QrqReUFLP0iOyErLHa8brw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 49A6818A6461; Thu, 19 Jan 2023 11:34:28 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.33.36.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01638492C1B; Thu, 19 Jan 2023 11:34:26 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <167391047703.2311931.8115712773222260073.stgit@warthog.procyon.org.uk> <167391048988.2311931.1567396746365286847.stgit@warthog.procyon.org.uk> To: Christoph Hellwig Cc: dhowells@redhat.com, Al Viro , Christoph Hellwig , Jens Axboe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, Matthew Wilcox , Jan Kara , Jeff Layton , Logan Gunthorpe , linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 01/34] vfs: Unconditionally set IOCB_WRITE in call_write_iter() MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2731229.1674128066.1@warthog.procyon.org.uk> Date: Thu, 19 Jan 2023 11:34:26 +0000 Message-ID: <2731230.1674128066@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Christoph Hellwig wrote: > We want to be consistent for sync vs async submission. So I think yes, > we want to do the get_current_ioprio for most of them, exceptions > beeing aio and io_uring - those could use a __init_iocb or > init_iocb_ioprio variant that passs in the explicit priority if we want > to avoid the call if it would be overriden later. io_uring is a bit problematic in this regard. io_prep_rw() starts the initialisation of the kiocb, so io_read() and io_write() can't just reinitialise it. OTOH, I'm not sure io_prep_rw() has sufficient information to hand. I wonder if I should add a flag to struct io_op_def to indicate that this is going to be a write operation and maybe add a REQ_F_WRITE flag that gets set by that. David