Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp1225666rdb; Wed, 24 Jan 2024 08:24:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IFG6182kigtA4PtNZoa795WY3EW3qGsWqbGN2UVOCb41yKpJfHGhEH/hiOH4UZO6uvZXFmr X-Received: by 2002:a17:907:d50a:b0:a2e:ac1a:974f with SMTP id wb10-20020a170907d50a00b00a2eac1a974fmr995417ejc.12.1706113472712; Wed, 24 Jan 2024 08:24:32 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706113472; cv=pass; d=google.com; s=arc-20160816; b=RbfoUNDVPNgi1ZdvEHS5n91FHxPQlJsavj45o3b44veimXaReTbvpYDZyhtzh4WzHq N2t+s5/eMZtW4qimY0h+eda0uCmLJm3LPZkf4mwnrtKQa3fkqe6gEnTkibV2rT6CJxE/ QBMsSsuhPlke7R0qudFfVkJm1uSOwwqLoZCAYPoeaHybQfjN5fd/gUy+MRh7w+ajdXR7 hbadLx2uRW2OSWFyHv0c/A9DgXtaHZIP3jJNHILuNj08cJaD8OTzrNj/XP1YIBc+AL5L 42NgYRSXFTcqJGkuwV1XxcxMJwMHKgFajz4FGj6xccLeqlqND8nWSLEbwh4SwA+LakC3 IsFA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=eMrT5P2w10tw7eLH7q5F2CQ18PCwIDF5TrbVadGlCl4=; fh=4YVsvSw89YLB8BwEpRY3CJXgqRUaRqMGbbw+saURfhY=; b=Qz7brv2KN66Cgn/27yChaaxAQLGDv8fj4d+8kpahTOtJzhIhe6+n66P0SaglfBVaBq bPqmNtw0SFa9zzQ+XMGr6klL+w3NdBgCW4PfsPBlHCnVmP1hx8fNOCMMuBevbAUt2e/C iPj61kkivyAtP/lvmuko1C/rk4TXd8J1V5H7JOhqDhhwxB8uc5+ZfdKV/GA0lQ49QcvG T49dAgV1SWhpzNWJblPNgRdLvF92FqCyQU6wF3QBwuBDvz0S9nV89RBqNFHgupCDoIZD fmDkrH/BJNHTMa/DpuAv+k11WD+tLj74d8atavNQan76tPdiMvUrb9v56Jf4zdrYwIkz Yqnw== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-37327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37327-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id f6-20020a170906084600b00a30b1d9552asi46610ejd.239.2024.01.24.08.24.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:24:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-37327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-37327-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-37327-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6EEF11F22E36 for ; Wed, 24 Jan 2024 16:24:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 445C47CF31; Wed, 24 Jan 2024 16:24:27 +0000 (UTC) Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 12B2E7CF22 for ; Wed, 24 Jan 2024 16:24:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706113466; cv=none; b=TRjzJZYyuFZSfNHs7kSruOj+VVtkYeRIUtfY7XejEUC3nVSHKl/x8Oa5bVAdSHPbQDNFWRZV8/iQ6ALjH8joBv1Tko08RcyBf/9T2SCH8+0R6BUXwotBdVfk79M/KP9PAps+d64RBGDHktzb8vrfPMjUJ3ywgRnaU+cYW2Br6zA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706113466; c=relaxed/simple; bh=cmh2v342drxF1dTH1nf4cchjsqCYIhUmT0Augauvd1Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LQfhqFJ1cGgb7XCNzr8wT6vPxcDIuy6Dp9DewBfYq1wUcjWtPpfbOzKBw+Vv8yGIDYwOEcCsefLdLVlVfsbuQvK+q87YFfsXgUAYPRd8sCI1Ftm8ggSrLjI7ILf+uySebXRotMK0lHSUtiB2uirfzezQAps1XqSW4fXntHK9F6E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=debian.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-50ea9daac4cso6196097e87.3 for ; Wed, 24 Jan 2024 08:24:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706113463; x=1706718263; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=eMrT5P2w10tw7eLH7q5F2CQ18PCwIDF5TrbVadGlCl4=; b=ozf7WMEjNDwBUwxoT9KEtt3OrEREL6cwQ/uDhYWO/gG6dJCUgwgZChm0eJOsez7bs+ lc6tfujwptyth+UK0A14l7/0h4JFF44xm1ueBjilJFlifuCWXOPk+40GED80fBwwt3Qt 7GXWhWtzg3IVNYjqXHRa6kdH0KHJ42FC06Sb1XJY5w1yhMjxeVBCpicl1kM+5p7GKIF9 KvXr6o67ILFXl3jg7Qf6q7WyZGybG25nIXLQTzaKZ7Hv64l/ZLKHOCAXPfVYv6gp4wPj WOEKzpSSXaywnkAb6Fk010r/UsA/NwVENDDwvofpc6F/CtMXGAnNK3aMlAURfH9iAZS0 tQ9w== X-Gm-Message-State: AOJu0YyHA/p5nFVY5GftLA/4edQ9C1BkMBBc7UC2lEdil5slpb1IC6aM 2VGevCAghKvcZYySyjtOkh7mDr/H5Mp26IQpMfkGsYSh3OKsKzS5 X-Received: by 2002:a19:ee10:0:b0:510:17b6:69e with SMTP id g16-20020a19ee10000000b0051017b6069emr68370lfb.89.1706113462769; Wed, 24 Jan 2024 08:24:22 -0800 (PST) Received: from gmail.com (fwdproxy-cln-011.fbsv.net. [2a03:2880:31ff:b::face:b00c]) by smtp.gmail.com with ESMTPSA id wh11-20020a1709078f8b00b00a26f6b8be1csm47026ejc.75.2024.01.24.08.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jan 2024 08:24:22 -0800 (PST) Date: Wed, 24 Jan 2024 08:24:20 -0800 From: Breno Leitao To: Marco Elver Cc: andrey.konovalov@linux.dev, Andrew Morton , Andrey Konovalov , Alexander Potapenko , Dmitry Vyukov , Vlastimil Babka , kasan-dev@googlegroups.com, Evgenii Stepanov , Oscar Salvador , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: Re: [PATCH v4 12/22] lib/stackdepot: use read/write lock Message-ID: References: <9f81ffcc4bb422ebb6326a65a770bf1918634cbb.1700502145.git.andreyknvl@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 24, 2024 at 03:21:26PM +0100, Marco Elver wrote: > On Wed, 24 Jan 2024 at 15:16, Breno Leitao wrote: > > > > Hello Andrey, > > > > On Mon, Nov 20, 2023 at 06:47:10PM +0100, andrey.konovalov@linux.dev wrote: > > > From: Andrey Konovalov > > > > > > Currently, stack depot uses the following locking scheme: > > > > > > 1. Lock-free accesses when looking up a stack record, which allows to > > > have multiple users to look up records in parallel; > > > 2. Spinlock for protecting the stack depot pools and the hash table > > > when adding a new record. > > > > > > For implementing the eviction of stack traces from stack depot, the > > > lock-free approach is not going to work anymore, as we will need to be > > > able to also remove records from the hash table. > > > > > > Convert the spinlock into a read/write lock, and drop the atomic accesses, > > > as they are no longer required. > > > > > > Looking up stack traces is now protected by the read lock and adding new > > > records - by the write lock. One of the following patches will add a new > > > function for evicting stack records, which will be protected by the write > > > lock as well. > > > > > > With this change, multiple users can still look up records in parallel. > > > > > > This is preparatory patch for implementing the eviction of stack records > > > from the stack depot. > > > > I am testing quite recent "debug" kernel (with KASAN, Lockdep, etc > > enabled). This kernel is based on > > 9f8413c4a66f2fb776d3dc3c9ed20bf435eb305e, and I found the following > > This version predates this series, as far as I can tell. Can you try linux-next? That is true. I will retest and let you know if it is still reproducible. Thanks.