Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3945759rdh; Tue, 28 Nov 2023 07:52:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IG5ccJgoBBPLZMaZ8lOoFbQdAAw05z+CH52XrXG322BjD4oyk4PQ4O2WUAFsVM9ebVn6b83 X-Received: by 2002:a05:6a20:9e4d:b0:14c:c511:387d with SMTP id mt13-20020a056a209e4d00b0014cc511387dmr17391431pzb.9.1701186770140; Tue, 28 Nov 2023 07:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701186770; cv=none; d=google.com; s=arc-20160816; b=mPynv1fmpf3Pp0Fa160vbOQpvL2EokqqJkmvIu82T5IcxnxlTdjL0mhg/3uoYPAoRw DQ7wCi/JdhjVFpqOh+VJfgvDYJLb0yPuTU3zRGgh1CHZ6C2lrngtjlLkcyLZiaNnT9g0 5Kd+Op7cwe/CbN13EzYywA70ZMHj89kf7HB6gRe33i0Lz9I660J94iAnNzVkeI2LZmok HVa+tCIhtMbsznmSpRuK4ITsEsTh6j09RicUK5URE0lhbAWWBqyq9morVTiTEF7FEYQh /3dvZcgs1O20kEzjJ3Ml5rdkYXyBmbwTxpKDgHnlHQdaopF77R7mIbTtOma6CWJsZzsV 06lg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JL7wIpfDDdhtOr8beykStcEisP2jRdaeRIzxJF2keWs=; fh=l6la9Iqnl4YvxqilG3k/S8tOuC5o3l/iUsxaTzm8nms=; b=XyKPT71tiLrBOUqvGtFyyT2gbK0rCtVHMsJiFQZbRjmB/Mfn4tnMiQsbWKFlh7AqZY 1/GFV349TMYZT5SD1jifnts1rJYgkqpXwNMVY2jD0ZHWymz3naEW8eqosSvJVLmy4p6z DaNe/vjD0XO8D5cECwDWcdH62u16HUHrOjwjSq0xAEKGGbtWY95QOX3wi37B+O3PPWY6 kvVF6IuwO8DOy33pETq2Wdr8rAzQw+MV2m43oQGKmpN0oFOZqis9uJmMyEG7yA+jPpRe nw6kbBZ+7CdhWwmui6CJsTshkyUjlRDTyaeepkUDNu1i3Bjjj7cQqvIuv1KGY+vvbaob lrMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qhCM0efN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id k1-20020a17090a9d8100b002800982aa84si13144757pjp.176.2023.11.28.07.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 07:52:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=qhCM0efN; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 9B966809FA74; Tue, 28 Nov 2023 07:52:47 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346424AbjK1Pwd (ORCPT + 99 others); Tue, 28 Nov 2023 10:52:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48210 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344823AbjK1Pwb (ORCPT ); Tue, 28 Nov 2023 10:52:31 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3CFB31BE for ; Tue, 28 Nov 2023 07:52:38 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 69B3AC433C7; Tue, 28 Nov 2023 15:52:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701186757; bh=W49ajMFtN9aTN86Tnl430idPA/txjACjmrkpyxn3DE8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qhCM0efNQ55/CadBsgmu3A+z7I663gGmRlop+aHtsSVP3W3KCJxS4fFnJj2rO9RpG y+R924PIXTrR+evJd3GTxqaL5irmDkrqNbRWw9SV1YHNS71I8J/El1OHEQtPkEIRyr Afc1O5Xcnr2agGFbz1OiKZ75NeDBlttGNDF5zEkddR7IRkSJ/bYJXRhvwXvYTDouWl WOc9GyV32DURezCRx7CTi+a6DGNmgsBWfsB2RHkt8xIdcAxiZzDkyVQICDB2vFML3C hmh8wYtpto+fz3KlsQeu2I/pmzyU/Po0vKVV7MZySBCX95gqixVMLw42/5bpJlCqj3 T2wz5oaTTY4Gw== Date: Tue, 28 Nov 2023 16:52:31 +0100 From: Christian Brauner To: Linus Torvalds Cc: kernel test robot , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, Jann Horn , linux-doc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, intel-gfx@lists.freedesktop.org, linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, bpf@vger.kernel.org, ying.huang@intel.com, feng.tang@intel.com, fengwei.yin@intel.com Subject: Re: [linus:master] [file] 0ede61d858: will-it-scale.per_thread_ops -2.9% regression Message-ID: <20231128-serpentinen-sinnieren-e186ea8742e9@brauner> References: <202311201406.2022ca3f-oliver.sang@intel.com> <20231127-kirschen-dissens-b511900fa85a@brauner> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 07:52:47 -0800 (PST) On Mon, Nov 27, 2023 at 09:10:54AM -0800, Linus Torvalds wrote: > On Mon, 27 Nov 2023 at 02:27, Christian Brauner wrote: > > > > So I've picked up your patch (vfs.misc). It's clever alright so thanks > > for the comments in there otherwise I would've stared at this for far > > too long. > > Note that I should probably have commented on one other thing: that > whole "just load from fd[0] is always safe, because the fd[] array > always exists". I added a comment to that effect in the code. > > IOW, that whole "load and mask" thing only works when you know the > array exists at all. > > Doing that "just mask the index" wouldn't be valid if "size = 0" is an > option and might mean that we don't have an array at all (ie if "->fd" > itself could be NULL. > > But we never have a completely empty file descriptor array, and > fdp->fd is never NULL. At a minimum 'max_fds' is NR_OPEN_DEFAULT. > > (The whole 'tsk->files' could be NULL, but only for kernel threads or > when exiting, so fget_task() will check for *that*, but it's a > separate thing) Yep. > > So that's why it's safe to *entirely* remove the whole > > if (unlikely(fd >= fdt->max_fds)) > > test, and do it *all* with just "mask the index, and mask the resulting load". Yep.