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 33512C83F01 for ; Fri, 25 Aug 2023 22:53:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 98A562800D9; Fri, 25 Aug 2023 18:53:35 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9132E2800CE; Fri, 25 Aug 2023 18:53:35 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 78CF42800D9; Fri, 25 Aug 2023 18:53:35 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 66E5D2800CE for ; Fri, 25 Aug 2023 18:53:35 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3F54D1A07ED for ; Fri, 25 Aug 2023 22:53:35 +0000 (UTC) X-FDA: 81164130390.17.23CCED5 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) by imf13.hostedemail.com (Postfix) with ESMTP id 7D9D220008 for ; Fri, 25 Aug 2023 22:53:32 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=F6apRE+S; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf13.hostedemail.com: domain of david@fromorbit.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1693004013; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pUz0mvDJOC9uQjgg5Uba361PK/6ticcfnjAOo3qTtYA=; b=8P+eFkWjkfW0HNC7k5YjoxmxIwjIBKyhPC7J7muVMjCu88VC9bXrIs5ny0w6rwLShfaNMk Qpr457fGr9RzcvJoYgPesPcxz/1r+Sh9WYkSX0abwoazU+Lx2kxyUHmHia4iu1p+vdxEN7 iJqJjC6ybPkM4Ms5fEpEC8qwRqDvw4o= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=fromorbit-com.20221208.gappssmtp.com header.s=20221208 header.b=F6apRE+S; dmarc=pass (policy=quarantine) header.from=fromorbit.com; spf=pass (imf13.hostedemail.com: domain of david@fromorbit.com designates 209.85.210.181 as permitted sender) smtp.mailfrom=david@fromorbit.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1693004013; a=rsa-sha256; cv=none; b=tcywaK1+/1f509AvfSsjchvxk5doj00ElBFXGXtdE3N52dA7DcJ4dIhP2LXhpboxn4iq8l geIKGdwonSQsvgmLPPqJ4ofdhkUZJm24bxcg2S7Er0Qo5qx1cYQcW0QS4VQ9GL33fhx/wR XFi0g1LuZO51AoYSYTcQLgxZ4oKtvcM= Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-68a42d06d02so1178155b3a.0 for ; Fri, 25 Aug 2023 15:53:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1693004012; x=1693608812; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=pUz0mvDJOC9uQjgg5Uba361PK/6ticcfnjAOo3qTtYA=; b=F6apRE+SrZTqCeuN1zLMRosK5ge3rhNKZnpOWKEqEdWDSsGDK7EQGyDQsb6/5NjMZA 3YMPbcTJ/D3BMiY5oD/xtnLm9pzhShZ6+Y7oDMWnO0DfFEZbieWLXokCpFNjeT5nfH1C s22NB1Wf7ErFiXowqbOOitIpN8YQ6wn+7f9hHAh/AXrGUdDwlOs/O2qrqcuv4RSpXcnU GbrxFepvZAk5VQgoyCmH+APqoM+wo3KvR0eb+zB1BsLvnPOQaJNrJEZsuvoY9FN/6wnP PBrjyNBdKOdo0Hj7mZUOQ9904vJZldE2dQql827LKN+udL2AKxU33q1Q1ADVqqMaFs/v qugw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693004012; x=1693608812; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=pUz0mvDJOC9uQjgg5Uba361PK/6ticcfnjAOo3qTtYA=; b=ZxPu7Od/lIourhC7APkPgkNmbEL03qKwDUM+2Q59Y61tB/vCwSnNlBzmcq5v5SFI1V lXm4tXg+A+uJ6S7aadevz5/+LSHApG8PacZN3EkutmLtWXi8qrjL6SSEYcO0FFyApEfz 33BFBma81iW2alKl5/4jU4wtF1AXaaAIenjAvNR9wJXMlBBoxZIAgAWf2WjGKt0VKNis ocho62AaweeHBQq1/9shgR70Xg1wse9G5On5Z6w+MRjXgm6eRLKhYZMBbRWtKHSiom67 ty31kXPEI+pZudgvmEVJ1zfwf4eBqs5VpWnJOZafyUHh8klR2W8xaz7ST5uI8lxIoVzj /EgA== X-Gm-Message-State: AOJu0YxIHUEsfvtI9Aj7dYFoS5pjyxFjHfpO0x/mZZYMNYkfw43iFWO+ MoeA4Z4FIr2ORbi6lUAjdiaerw== X-Google-Smtp-Source: AGHT+IF7qLruqklxY40yAH4SKvsJCnFBTQ8pg1x9p8DXB9ryPTSvbA4aGhPPBTQdBXYgxxyeFGZdhA== X-Received: by 2002:a05:6a20:7354:b0:13d:5b8e:db83 with SMTP id v20-20020a056a20735400b0013d5b8edb83mr20399311pzc.9.1693004012072; Fri, 25 Aug 2023 15:53:32 -0700 (PDT) Received: from dread.disaster.area (pa49-195-66-88.pa.nsw.optusnet.com.au. [49.195.66.88]) by smtp.gmail.com with ESMTPSA id u15-20020a62ed0f000000b006887be16675sm2060364pfh.205.2023.08.25.15.53.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Aug 2023 15:53:31 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qZfgG-006WDY-1c; Sat, 26 Aug 2023 08:53:28 +1000 Date: Sat, 26 Aug 2023 08:53:28 +1000 From: Dave Chinner To: Hao Xu Cc: io-uring@vger.kernel.org, Jens Axboe , Dominique Martinet , Pavel Begunkov , Christian Brauner , Alexander Viro , Stefan Roesch , Clay Harris , "Darrick J . Wong" , linux-fsdevel@vger.kernel.org, linux-xfs@vger.kernel.org, linux-ext4@vger.kernel.org, linux-cachefs@redhat.com, ecryptfs@vger.kernel.org, linux-nfs@vger.kernel.org, linux-unionfs@vger.kernel.org, bpf@vger.kernel.org, netdev@vger.kernel.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org, codalist@coda.cs.cmu.edu, linux-f2fs-devel@lists.sourceforge.net, cluster-devel@redhat.com, linux-mm@kvack.org, linux-nilfs@vger.kernel.org, devel@lists.orangefs.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-mtd@lists.infradead.org, Wanpeng Li Subject: Re: [PATCH RFC v5 00/29] io_uring getdents Message-ID: References: <20230825135431.1317785-1-hao.xu@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230825135431.1317785-1-hao.xu@linux.dev> X-Rspamd-Queue-Id: 7D9D220008 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: wja6xhftijzc6fhbmksnqm8b3tbroy8b X-HE-Tag: 1693004012-278980 X-HE-Meta: U2FsdGVkX1/L2gEIRVy/wchO+rG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acIIx/HeWJtFjFyFhdUlG8bnLHRLi4RI34LxX5XSciIE/zjD8gPkQkt1szJdPXMog+opMvZxo7nGrIci7EEWl4s1Z/NhRr6xbI6nDseaoEEdBrUqhkbG858OKbVcogqHV1LSTElNyTMIcWYleC31uezdrs6CAVIBuq49TZ2WX5UNmpMPr+8rvuFMGco3IIh6dsdK8Yzg1m7TA0uGp7z2XylyTRBAnhsbd9g7nWFqV1cwRIlTGGW4JxP8xHLXqcXihXYLR60P5Dyyid+9vHJIOACgTFlANTXTrDYtO43wEGTYNjv6oZaHVLJtTJRpCP9EJCSI9lLI011rERmLMRtVupFpjZ6euB0OGo9aWpRaiawk0mtW8lwpPHybsqUy0WHcujDKEEC/oNtooTTzbdBl3QSTSLhaVoxB/NNii2GcwSVkJskcnlNcr2djZntC51oqIdpGG9i8AJw1VGNEwS2PgNDQi9hTT2uh/u/C/OUhLqrD1m9nwoofoqO52AFrwsC2uHCO7vNv+ssNSlLEbnR++w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Aug 25, 2023 at 09:54:02PM +0800, Hao Xu wrote: > From: Hao Xu > > This series introduce getdents64 to io_uring, the code logic is similar > with the snychronized version's. It first try nowait issue, and offload > it to io-wq threads if the first try fails. > > Patch1 and Patch2 are some preparation > Patch3 supports nowait for xfs getdents code > Patch4-11 are vfs change, include adding helpers and trylock for locks > Patch12-29 supports nowait for involved xfs journal stuff > note, Patch24 and 27 are actually two questions, might be removed later. > an xfs test may come later. You need to drop all the XFS journal stuff. It's fundamentally broken as it stands, and we cannot support non-blocking transactional changes without first putting a massive investment in transaction and intent chain rollback to allow correctly undoing partially complete modifications. Regardless, non-blocking transactions are completely unnecessary for a non-blocking readdir implementation. readdir should only be touching atime, and with relatime it should only occur once every 24 hours per inode. If that's a problem, then we have noatime mount options. Hence I just don't see any point in worrying about having a timestamp update block occasionally... I also don't really don't see why you need to fiddle with xfs buffer cache semantics - it already has the functionality "nowait" buffer reads require (i.e. XBF_INCORE|XBF_TRYLOCK). However, the readahead IO that the xfs readdir code issues cannot use your defined NOWAIT semantics - it must be able to allocate memory and issue IO. Readahead already avoids blocking on memory allocation and blocking on IO via the XBF_READ_AHEAD flag. This sets __GFP_NORETRY for buffer allocation and REQ_RAHEAD for IO. Hence readahead only needs the existing XBF_TRYLOCK flag to be set to be compatible with the required NOWAIT semantics.... As for the NOIO memory allocation restrictions io_uring requires, that should be enforced at the io_uring layer before calling into the VFS using memalloc_noio_save/restore. At that point no memory allocation will trigger IO and none of the code running under NOWAIT conditions even needs to be aware that io_uring has a GFP_NOIO restriction on memory allocation.... Please go back to the simple "do non-blocking buffer IO" implementation we started with and don't try to solve every little blocking problem that might exist in the VFS and filesystems... -Dave -- Dave Chinner david@fromorbit.com