Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp140117rdb; Fri, 29 Sep 2023 21:15:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkW847XQ7b4eva8E0uwoTtnOmYORsW8xn90BAmNRBs0Z2vmK8IWxn2TkVUsUyyZSRYBkVE X-Received: by 2002:a05:6808:a8a:b0:3a9:bc8d:42ed with SMTP id q10-20020a0568080a8a00b003a9bc8d42edmr5751953oij.43.1696047342522; Fri, 29 Sep 2023 21:15:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696047342; cv=none; d=google.com; s=arc-20160816; b=VKAuW6tgjBND06el1u0dzDa/Uvw40GVnU1tK0oxD+HwaxpsPJ2QSHni1Sq9qioeHfQ FNBuY0nb3Yl9rCWCTGh8noL5o18uqcI9EQOjeMciYVGgMUUFFw2RlqCFwLXOV/OQCY+c k+cfy/EGUn12j6FHvp2ifWlFatLRbDrDKIU29qfBNvMI6gZGscKvJaTVndwS1wApUF51 DqyTLy9/MkzxvzDSOZqkkhmXZfBHzrDncajTtORxgbKXUk5IthGSgcbSNh489eVBAjdI bakVFCURv3QOJ79whV8xBpZTzF6Pn1jpwfyPbXj4hz5xhckvGfVS+4zJnPNPr345FGhf iVhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=Y9BzlJqBcof6n6pTueaTjw4kqspqP+j9P0b11XcgH9M=; fh=pnEhZf87qYKplBmRfld98zWOvmIKbCz6g2kP01iSrd8=; b=Y3ePUx2YsEUn2agQEalM3oj06tswKPY+UfakIFvtp0Vwy9r70pIIrGyTyj35kDP533 G+VFTCozSL9jLiBh7/pxFmkbPGwCJbah889kNri6nIF0kCpfneB+TJAAChbyYrqJSu5u I/H9dgTKBmG2srIzBl4BaaTSFtA4W4g3xzskYfIIyDqkRjflFoTxc/QHnZsq7rNQtfed fb5Gh99R1Rrv+rHEzUdca438t2iuzXGDHvMssGX2Hq/CKAbZellRnbRNGDSvphqmchRt Mf/XtUtP+Na+kmtlzKTGMY3q1DF0etjpWdGDEanbIPwYFeIC1SD0kSVtJOwOBeq+0kQO 2jnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnOULgSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id j191-20020a638bc8000000b00578ccb95206si21906169pge.745.2023.09.29.21.15.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 29 Sep 2023 21:15:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=CnOULgSo; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id EEF9A806AA31; Fri, 29 Sep 2023 16:03:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233922AbjI2XDB (ORCPT + 99 others); Fri, 29 Sep 2023 19:03:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35388 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233820AbjI2XDA (ORCPT ); Fri, 29 Sep 2023 19:03:00 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6524AF7 for ; Fri, 29 Sep 2023 16:02:58 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1c6185cafb3so21135ad.1 for ; Fri, 29 Sep 2023 16:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696028578; x=1696633378; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=Y9BzlJqBcof6n6pTueaTjw4kqspqP+j9P0b11XcgH9M=; b=CnOULgSoeqtnG2DEUO92aN94BuTOfYs1ZZ+MDYf09bZOpvPdeCdrA2rdvSCOO8Nf0u JtWyTEI9s+G11oI9c0tH8XsypgGgTTUHiPsn8KoJaTcdpRD69uWn7Ejb6vWll1+c3t4t DH9u1UK3VGkxQILF97rWzZp0P+MBDLMAp5pZGQ10FnbeLFYnU5wVCluqW6Dy/OJQVyPM iTakiENrf3f613oXHaeFewGif0PpP/7DifAz5tBRttkYFmo2W34jO94yaPPc5s26Pg8r j5wDqFyFVxwPAcr+R/AQuDnvz+SHgBnaWc52SulMzzwmcON42aGd96z6NLTSVQo5cD1j TCOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696028578; x=1696633378; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y9BzlJqBcof6n6pTueaTjw4kqspqP+j9P0b11XcgH9M=; b=YkCoEZXs7i6ROQmRhkQOJXYZtMyRyKnbjbQIoxM2ANQNXNaGV8KxcWzzJwQMwP7PVj AyNnwloaSX7y4dLurJA7IYgFNhY8fbDu38UJQqL/cSnWe48jKIqRQjXQWVUSVU2JsTiV r07HReUP/l+SygrcQhjp0liN1DZL/kqb/JS7D0WKhlS0F8QOGjuuvjQFdgoGQE1H1HF7 WNxj/pB/qnGMKRRo9NVv8NFLhzo4Qi9aMumTck/1BZzq878SrFW3fpU9xioK66+L9BnI ds8SY3RjqOFqnOc6r4DyzGcAJytKon40zu2GruAa1PkBi4YLtCqaWeTFGHyufrlgYGtT L5AA== X-Gm-Message-State: AOJu0YyZEP8GvB/ZFSy3J0hsPZ6Noj6hGyi4/FRBj3MRR1BTLOxpD5zE sRDtn76wRAl48FoabloYB9tBW5IGEnfsRRpnX0jw6w== X-Received: by 2002:a17:903:184:b0:1c2:446:5259 with SMTP id z4-20020a170903018400b001c204465259mr15735plg.19.1696028577492; Fri, 29 Sep 2023 16:02:57 -0700 (PDT) MIME-Version: 1.0 References: <20230928-kulleraugen-restaurant-dd14e2a9c0b0@brauner> <20230928-themen-dilettanten-16bf329ab370@brauner> <20230929-kerzen-fachjargon-ca17177e9eeb@brauner> <20230929-test-lauf-693fda7ae36b@brauner> In-Reply-To: From: Jann Horn Date: Sat, 30 Sep 2023 01:02:21 +0200 Message-ID: Subject: Re: [PATCH v2] vfs: shave work on failed file open To: Matthew Wilcox Cc: Mateusz Guzik , Christian Brauner , Linus Torvalds , viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Fri, 29 Sep 2023 16:03:36 -0700 (PDT) On Sat, Sep 30, 2023 at 12:24=E2=80=AFAM Matthew Wilcox wrote: > On Fri, Sep 29, 2023 at 11:23:04PM +0200, Mateusz Guzik wrote: > > Extending struct file is not ideal by any means, but the good news is t= hat: > > 1. there is a 4 byte hole in there, if one is fine with an int-sized co= unter > > 2. if one insists on 8 bytes, the struct is 232 bytes on my kernel > > (debian). still some room up to 256, so it may be tolerable? > > 256 isn't quite the magic number for slabs ... at 256 bytes, we'd get 16 > per 4kB page, but at 232 bytes we get 17 objects per 4kB page (or 35 per > 8kB pair of pages). > > That said, I thik a 32-bit counter is almost certainly sufficient. I don't like the sequence number proposal because it seems to me like it's adding one more layer of complication, but if this does happen, I very much would want that number to be 64-bit. A computer doesn't take _that_ long to count to 2^32, and especially with preemptible RCU it's kinda hard to reason about how long a task might stay in the middle of an RCU grace period. Like, are we absolutely sure that there is no pessimal case where the scheduler will not schedule a runnable cpu-pinned idle-priority task for a few minutes? Either because we hit some pessimal case in the scheduler or because the task gets preempted by something that's spinning a very long time with preemption disabled? (And yes, I know, seqlocks...)