Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp1288093rdd; Wed, 10 Jan 2024 15:01:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IH6Bm8GuLU6ag7cTA4FqCN3F/syttx0x4TVfCLIYVfL/nJNSRLLQdtJt4mLXGk0ZuQ7CADe X-Received: by 2002:a17:903:120a:b0:1d4:e22f:8424 with SMTP id l10-20020a170903120a00b001d4e22f8424mr255471plh.55.1704927705576; Wed, 10 Jan 2024 15:01:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704927705; cv=none; d=google.com; s=arc-20160816; b=vWuLK/GfjRwLRj6eWPhqZpRMlRztASzlYdJoSbvy5NHCjFO+9wwjc+Bo70ztzj+FKK gbNoT/O+p6H58g7ravBZE/HX74m8wL0hkl3Pjh5H4ZArPwFYXllZVvpwpKUDwPLF1dTU HKinpOBDPnNvyIoJfTKt3f6tBcx0gAOVZq6ZnHCIiAeL/Pdxo4xps+UdaPchUayPrnYU APopytreZdelVJ4OKeoIBhs+Acpol0YLgNqM022N0m82DpTxBdtfxiLYwUO3DB8Yj/IC yC2LeHhc6aLBxemYr7LYq610ZLjehJ5lei9Tq35kpThHtB5R0eKOITKbet7JH9j2kpNi GYaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=ljYhkcLCrxeGGTJaNjy+zm06+JUi70LsYnSqB5d6LSk=; fh=nWr82wMEO9GKNdR/jfN+lbsaiqRsw6PK5qZUzVcrvhM=; b=lis4eFQuXZL5GSn6pFGP1yeNClZeViDJD0v6frXjINi+AxtBliudX2qFosRZhhbgA/ cHISIu73NP3AgK2wWl7wJU2taZH9nPUZb7xCHCS4zGr5fmPYBHgb0rmbUNT+wlD8sJ+1 CizOxXowTvar0IKC/Mnn0QQ4kKvqE/0JDeKZNHe46Ho6mTrF3VUH9/NXkdoRYMytm7Qc KKkpwPTxHF5VTZIJDTVQS0Aqa2Xxg2HcLYsXUis2IO9WIS/BT2F6vEI7KUXC9kNbxjhr q9otVpHaFz5R5NvzTbRttetnylGjwOafuB8IKLPlN1B2iyMv3UvI2IDzFZZ1ER1K5r/N ms3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a54uqtiX; spf=pass (google.com: domain of linux-kernel+bounces-22870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id t9-20020a170902b20900b001bf1005924csi4518994plr.321.2024.01.10.15.01.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jan 2024 15:01:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-22870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=a54uqtiX; spf=pass (google.com: domain of linux-kernel+bounces-22870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-22870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id EBF9828914A for ; Wed, 10 Jan 2024 23:01:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 703A94F898; Wed, 10 Jan 2024 23:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="a54uqtiX" Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E6B724CDE1 for ; Wed, 10 Jan 2024 23:01:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1704927697; x=1736463697; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=3+OaQQdytDnhe9opJRAlwti2hrQ+ESQmSUVck2AcGXs=; b=a54uqtiX+nUDe6OYc2l18sBNz2YMfzXGlds07ew9wxcLr4MxbfwA4vk2 ypBRFPA4yTJ606U5FvfE9D1Y0SwxjjK8lplHH/Hd2GOIMmS7zmugRDxaw VgwJmH6o5vOpXmwQuIT/yclOS2C9NrN3aDBa1nuSAQgqyAEz7mNmJpAv4 AbpHpKhBDBUwGrfCn3IT2w60ebG/F0OytmGD2Ws7N6owOpQolftHTr/LX DP9G6tdx3tbq3zaMRkNR04Yxccz7Dp7FLYuRfCHoXaMutyZTdQZqiV7q6 wnT3s8l1GtT9k7JMaLlcmSzmp66PfZguXqmrKsbPJ+j+/yRfUuTVFzffw w==; X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="465067552" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="465067552" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Jan 2024 15:01:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10949"; a="925799297" X-IronPort-AV: E=Sophos;i="6.04,184,1695711600"; d="scan'208";a="925799297" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.54.38.190]) by fmsmga001.fm.intel.com with ESMTP; 10 Jan 2024 15:01:36 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 2636F301C53; Wed, 10 Jan 2024 15:01:36 -0800 (PST) From: Andi Kleen To: Oscar Salvador Cc: andrey.konovalov@linux.dev, Andrew Morton , Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH v4 12/22] lib/stackdepot: use read/write lock In-Reply-To: (Oscar Salvador's message of "Wed, 3 Jan 2024 10:14:42 +0100") References: <9f81ffcc4bb422ebb6326a65a770bf1918634cbb.1700502145.git.andreyknvl@google.com> Date: Wed, 10 Jan 2024 15:01:36 -0800 Message-ID: <87sf34lrn3.fsf@linux.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Oscar Salvador writes: >> >> With this change, multiple users can still look up records in parallel. That's a severe misunderstanding -- rwlocks always bounce a cache line, so the parallelism is significantly reduced. Normally rwlocks are only worth it if your critical region is quite long. >> >> This is preparatory patch for implementing the eviction of stack records >> from the stack depot. >> >> Reviewed-by: Alexander Potapenko >> Signed-off-by: Andrey Konovalov > > Reviewed-by: Oscar Salvador Has anyone benchmarked this on a high core count machine? It sounds pretty bad if every lock aquisition starts bouncing a single cache line. Consider using RCU or similar. -Andi