Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4666719rwb; Tue, 8 Aug 2023 11:47:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEweUBgZQVzwsBcpz7KUOCzpaaGbUkVbf69aXEnYBERulkQ2vo6BDUjGYWr/W9RVDnj61lo X-Received: by 2002:a05:6a21:998b:b0:140:a0dc:c834 with SMTP id ve11-20020a056a21998b00b00140a0dcc834mr519947pzb.24.1691520425004; Tue, 08 Aug 2023 11:47:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691520424; cv=none; d=google.com; s=arc-20160816; b=W8rOqNct4p6UCPY671a5FU3CThFx1Md8Rw2baTFQG9HoD/BLE+uQTEb4ZD80KVCDzM Mqa5oBmNL5h0sR28PMDpb7uUI5GVJaAUvfSVdD0aOJKhzpS/x4qGQZJIXUn3qmq3kfXW q8awlXRdR7tyiPuwGmGIYDIPUOgFIgWUT9UmG3AA/hZD9tWYGnC/ulw6sz8uSLsP/IAs nCqQgdScP0Squ7xdwpU4vifXvJSQ2pHU29YADfO9gg5JsFXu8wubrPIASAv7rjwl30lr XK3u3/S2Y/scbaOoBlSNceH9zGoap+8hbdTHkJZVh0sS6C5eucecRsJdcLxQCymzhJpU oxBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:references :in-reply-to:mime-version:dkim-signature; bh=GCxwlyhJ8vXEVNF+yz9sQrPr3bcnp/8Z+q3sGhYbKzY=; fh=YX72GWvnC0SinfzsjaevgOFQuHGMkRxIQgwI7RgHPro=; b=Obd8n3DfHcovyT2XJJs74avvtmWhXrlHPhEZ50bwXcrWOp2DGPt/w7tfotccYQ/Qgu zrLDVVoO5pQvRcpasoc+ZLNMnAplZcZ0tzQvEQRaqbwjy/3rPaYdDkThY7NyhgxM+w6k umJN/apukNZ5lW65B8QdYE+ZdPP0QOS9a9KdQGJGo3UlONB7N5AHEefmgES84icrwMbE 4oZn2sIrCyhFnjU2wdmsJ2ty5AVeKeYvda2e+cz66JzpqR4aW+AmJP+A/tSRcHLd77tC q0eAhh6KlY9Gt0TFLFYLZjjon/Wl128iMuT2GE/Vm3nm1bmeBEhECkV2VP2A7VZg8ROu 6qOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eyYEBmT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p7-20020a637f47000000b00564bcae8b74si7022995pgn.870.2023.08.08.11.46.52; Tue, 08 Aug 2023 11:47:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=eyYEBmT8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235099AbjHHRvc (ORCPT + 99 others); Tue, 8 Aug 2023 13:51:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230452AbjHHRvF (ORCPT ); Tue, 8 Aug 2023 13:51:05 -0400 Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 847EEB4F3A; Tue, 8 Aug 2023 09:22:51 -0700 (PDT) Received: by mail-oa1-x2a.google.com with SMTP id 586e51a60fabf-1ba5cda3530so4607646fac.3; Tue, 08 Aug 2023 09:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691511749; x=1692116549; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=GCxwlyhJ8vXEVNF+yz9sQrPr3bcnp/8Z+q3sGhYbKzY=; b=eyYEBmT8U9BS0g9YiDGnxXjtGCDVRksgzluqxEPtICdyaVdggKOALR63x2PcECwMqD 5MoUQi8ERs4RlPVnesDEPYSjONko7qcfZsBrumb9x1K1/UMqvjU26Ho3PAwaGMrqkdsh ScPN/kEIF334KbdDY43rB1lWj1V2DpiRtRIlglLsvSyhGOtWHH4uZ5qZfSAujgW1vZQ3 wGm3VnLKKWDjf9nVgnyUjvaCfERuKMc0GG8YbfU9/RuaYpguciP86d5QB2kAR0uTTagt 8fxrg3rNl05BnC8H+imitZHN34Es5Hhjc+bJqnaV/XPK1IrQNBZJcvojPsbgPpxcMcCz 2eQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691511749; x=1692116549; h=cc:to:subject:message-id:date:from:references:in-reply-to :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GCxwlyhJ8vXEVNF+yz9sQrPr3bcnp/8Z+q3sGhYbKzY=; b=mEqKU1IdgBfyNl3nJ6i5LmvNUWZWX6OPVsq16dBm+KPlSxwbVh8bvGkVG5oyr9oc7C 9xlv4NG0DIN3a0zRu4cZ4JIw8WrknQLkJl2Pbjhk2UCd1TwuMmCwbzcJKcC9DZ4dedTx SWG2JvBQrvW2dpGEJJ7Cru9vGumjtQgeEbvGXMhf5Pl3yDUPkQsY8MQmcQ8b+Uqzxd7+ D5wlBgWHMSz8pRqynJxaBXTRuOl6368guFB7s+XDhJeW2BL81LSk3KmtfkGfCLYN85Hb tbDWukcrhFivCsIMZtPefX96OBVre4D8S+fjNyP3q10E+y6CM34NMHar2hUE+C0hXHz/ Q0rA== X-Gm-Message-State: AOJu0YzL3KroaHJUozzC5NGGeeiKF092qAv0lcJqbHRirFK2BO7flWOT mjWq3YIKCkxLVXbMMzcZoeHAmn1mRgTWyvBAVEiv8Ihf/wE= X-Received: by 2002:a05:6870:612b:b0:1bd:55be:5880 with SMTP id s43-20020a056870612b00b001bd55be5880mr14170980oae.42.1691486507460; Tue, 08 Aug 2023 02:21:47 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a8a:696:0:b0:4f0:1250:dd51 with HTTP; Tue, 8 Aug 2023 02:21:46 -0700 (PDT) In-Reply-To: <20230808-unsensibel-scham-c61a71622ae7@brauner> References: <20230806230627.1394689-1-mjguzik@gmail.com> <87o7jidqlg.fsf@email.froward.int.ebiederm.org> <20230808-eingaben-lumpen-e3d227386e23@brauner> <20230808-unsensibel-scham-c61a71622ae7@brauner> From: Mateusz Guzik Date: Tue, 8 Aug 2023 11:21:46 +0200 Message-ID: Subject: Re: [PATCH] fs: use __fput_sync in close(2) To: Christian Brauner Cc: "Eric W. Biederman" , viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, oleg@redhat.com, Matthew Wilcox , Linus Torvalds Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/8/23, Christian Brauner wrote: >> I don't think perf tax on something becomes more sensible the longer >> it is there. > > One does need to answer the question why it does suddenly become > relevant after all these years though. > There is some work I'm considering doing, but before that happens I'm sanity checking performance of various syscalls and I keep finding problems, some of which are trivially avoidable. I'm genuinely confused with the strong opposition to the very notion of making close(2) a special case (which I consider conceptually trivial), but as you noted below I'm not ultimately the person on the hook for any problems. > The original discussion was triggered by fifo ordering in task work > which led to a noticable regression and why it was ultimately reverted. > The sync proposal for fput() was an orthogonal proposal and the > conclusion was that it wasn't safe generally > https://lore.kernel.org/all/20150905051915.GC22011@ZenIV.linux.org.uk > even though it wasn't a direct response to the patch you linked. > Ok, I missed this e-mail. It further discourages patching filp_close, but does not make an argument against *just* close(2) rolling with sync which is what I'm proposing. > If you care about it enough send a patch that just makes close(2) go > sync. But this is precisely what the submitted patch is doing. It adds file_fput_sync, then adds close_fd_sync which is the only consumer and only makes close(2) use it. *nobody* else has sync added. One can argue the way this is sorted out is crap and I'm not going to defend it. I am saying making *just* close(2) roll with sync is very easy, there are numerous ways to do it and anyone involved with maintaining vfs can write their own variant in minutes. Basically I don't see *technical* problems here. > We'll stuff it in a branch and we'll see what LKP has to say about > it or whether this gets lost in noise. I really don't think letting > micro-benchmarks become a decisive factor for code churn is a good > idea. > That would be nice. Given the patch is already doing what you asked, can you just take it as is? I'll note though what I mentioned elsewhere (https://lore.kernel.org/all/CAGudoHEG7vtCRWjn0yR5LMUsaw3KJANfa+Hkke9gy0imXQz6tg@mail.gmail.com/): can they make sure to whack CONFIG_RANDOMIZE_KSTACK_OFFSET=y from their kernel config? It is an *optional* measure and it comes at a massive premium, so single-threaded changes are easily diminished. -- Mateusz Guzik