Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2920041rdh; Mon, 27 Nov 2023 02:13:14 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpZUuoU802GqoSNntpMjErSRNBk49vhwFKQNjwMSMj/c7fcFDidKmMMR3JcOC13bNLjsWB X-Received: by 2002:a05:6a00:1ca3:b0:6be:5a1a:3b93 with SMTP id y35-20020a056a001ca300b006be5a1a3b93mr10248413pfw.4.1701079993938; Mon, 27 Nov 2023 02:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701079993; cv=none; d=google.com; s=arc-20160816; b=xQBdGkvrXFRqRPBONu5cXZo+cL1F5jMkjijADkFrWOgZUYtlmpff4is0zfaU25l16O hekUvpt0dkUJUPo0qCiZl+/dC5R8ORbsql86KtU7NEEgomUEvUPmJQz2/CIoxB+aGR5Y U5W074pGiYBXgQEPYjGL+DBIOJoUJzigEaPL7Q5XIF0E1R06S9JI4Z4cNW0UBst5o8sz 4vgN00VVsUSwRU1latE9drrZnqquFqmesMbApzWv0OHGCofwHAENefkEtXa+gd4/Yyke juTdF5FjvGddcCUkoMPNCe0xiMi5LccxMH2gSa5PqbydLYhvGxEMEdU/MJqyVCyZbaNG eE0A== 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=Sq1gAk2zwxq74Tc7QHBc79DyNeUNEE2Bk30Qw3il02g=; fh=l6la9Iqnl4YvxqilG3k/S8tOuC5o3l/iUsxaTzm8nms=; b=yaH9yWEFRppWREUdo7Bd8PbL6PiRwUlRuNRjJia/b2xIBj7UEPufTj0Izdw/6p6bhs SiGPOAbxtoUvhq1jqIl65cTgnDnF99iyMImqLcNkEPsQ7PJ8NSMUwy0yfOu82XdBKYDi opRseAl23y9BNBPbooFzORDGBbUEKlISFA2AK+n+DN0lnIC6VJB1LKexCrCVzvQbyzd8 OTuMbdNEqMURAkEdEHSgc2GM9Dv33bgTi3Q85NQqo/R1aNalZjuCVXA3Y3HI0Yay9X/Q XO9p1L7V/Mubw/wklp25lOURZ8vMY5tZWtLDwfJrKa1L27cwZZDuMjPTknjsxKDsT2zQ oKkA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gua2LBTg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id fa33-20020a056a002d2100b006c0035ff9dasi9477034pfb.198.2023.11.27.02.13.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gua2LBTg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id E3395806B54C; Mon, 27 Nov 2023 02:13:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232741AbjK0KNB (ORCPT + 99 others); Mon, 27 Nov 2023 05:13:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232679AbjK0KNA (ORCPT ); Mon, 27 Nov 2023 05:13:00 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4FBB0131 for ; Mon, 27 Nov 2023 02:13:07 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8059AC433C7; Mon, 27 Nov 2023 10:13:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701079987; bh=fGgNP5lLqq06gIKE/Ay6zDb25xpoQWkuhpClm6E4Od8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gua2LBTgox+kA/7qWhP6aBawjywyAf4plI5DEpsh3Ijh1TglJVJalcbdoLVzj+4dc QSMDDVQUYBZq1RQQekKvMiY6PsTT6dCQ73qwrTxCOVqua3ItxtNNh1CT5mMK1rwkOo pNmaaaZz8ibyvGn9pVWA4lfTSRxkUENw1NZF/9NxE7CpRhALbo9b8kxwPL+7e+tpwW hsJPsy3p5qFhBnTvSRETrsFsNAloxWs+4rOiSkqNw7cPppUIDXmoc2h/jD710Ik/tG IqbNDJzviU6gnDPxieDGBRlc5nKcmAT2tWnTWaAy3wiDb1nqr1v6ODL4SEN8gHX01N FGTK2menaKnbw== Date: Mon, 27 Nov 2023 11:13:00 +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: <20231127-protokollieren-ermuntern-748cc3855fe8@brauner> References: <202311201406.2022ca3f-oliver.sang@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 27 Nov 2023 02:13:13 -0800 (PST) > I took a look at the code generation, and honestly, I think we're > better off just making __fget_files_rcu() have special logic for this > all, and not use __get_file_rcu(). My initial massaging of the patch did that btw. Then I sat there wondering whether it would matter if we just made it possible to reuse that code and I went through a bunch of iterations. Oh well, it seems to matter. > Comments? I also looked at that odd OPTIMIZER_HIDE_VAR() that Concept looks sane to me. > __get_file_rcu() does, and I don't get it. Both things come from > volatile accesses, I don't see the point of those games, but I also > didn't care, since it's no longer in a critical code path. > > Christian? Puts his completely imagined "I understand RCU head on". SLAB_TYPESAFE_BY_RCU makes the RCU consume memory ordering that the compiler doesn't officialy support (afaik) a bit wonky. So the thinking was that we could have code patterns where you could free the object and reallocate it while legitimatly passing the pointer recheck. In that case there is no memory ordering between the allocation and the pointer recheck because the last (re)allocation could have been after the rcu_dereference(). To combat that all future loads were made to have a dependency on the first load using the hidevar trick. I guess that might only be theoretically possible but not in practice? But then I liked that we explicitly commented on it as a reminder.