Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp1481358rdb; Mon, 19 Feb 2024 18:28:19 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVmpGMWpMtbRuaYq5/7Slmr2UiGKIDZaOyGCUj7lfhsSRHZmR2puixZfUSfwJsssnloLKdgPVNLcv2DC+qngrZR+9DCvt5GCpHMIsh9Sw== X-Google-Smtp-Source: AGHT+IFUYVoUljLBm/yGdaDn0ykzy4dt8z54yJtCpyODutnJsfF8OhKtUozWZ221VyfCIs0P8KDT X-Received: by 2002:ac8:5d0f:0:b0:42c:8b9a:e252 with SMTP id f15-20020ac85d0f000000b0042c8b9ae252mr32384058qtx.16.1708396098973; Mon, 19 Feb 2024 18:28:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708396098; cv=pass; d=google.com; s=arc-20160816; b=gQny3pv+Y+FiRU6s7iYJUXA+HWQyv5AkVyu6BkCMHg+x7+tCwcNCAoOQefyAzrZDnI sPYes1xcxpse/10rDSPZTOnhzhyXg34kW2r31jYIL/wBMwVudkarS2cGTpw5na9cTdXk 1n2hZWz7ZdlGs9CfY9vAsUHH1C4AaBLLiQfnMPunvORPT0I35Qu2hurZFGlTK6CcxtiN WVs6WedsnrCEf/AVlYFgfk1gBmAwTCTP4E9c75c5vEWwH8HaNrLMjrSUMTYWhXEH3odn AGbzW2BFDcBwIJI1XQd+NdQTuVzoEjr8Kqo0senqvusDhjEBjD05aTGk00yV8N9onaCC rAmw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=ndhIQTbpvgCOJH+JSwApusG48hxze6GXsVsyY1smj50=; fh=UU1IWnKdC03ksLe/0K13std8TE7opn7cSIBGZhLv4v8=; b=PGdkg0XrcKC1mfy7eFFOPoHiso3M/wXB9JQauDrZM18wRp5jlGZ0/3S3mzpWUhoFbu 6m9oNfxNxsaAqN7vpvHbeuBRc/BtA5A7go7jc3KAMCswGK8MoUS/oy6hj1V7+lTL86ou P7636YM4yPjDbNU5Y8yISfVyBYC3OTRZxZ+PbRHjeXs8Rz84b5uDJ8C6z3bt6UvS+pe8 6WqEsh0Ib3xwRV9ktE80LBRYdqUu4fcCBbQMzm6vEtDSiHZg53AmthgfqVukFQs10Urk r19WVAjbrFG//ZuClb0iwdhEFdtTILP3hK7BZzf9EyV4oVE1qMpKMUe7867VdO1AKI9C jniw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="ltWv/YZq"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-72216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72216-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c14-20020ac853ce000000b0042c95f8155bsi7350509qtq.59.2024.02.19.18.28.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 18:28:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="ltWv/YZq"; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-72216-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72216-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A57C31C22489 for ; Tue, 20 Feb 2024 02:28:18 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4E61145944; Tue, 20 Feb 2024 02:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="ltWv/YZq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 7132D1E88A; Tue, 20 Feb 2024 02:28:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708396090; cv=none; b=igjkzqW/GHKnNFfRkXwumAvNcDqaKAxdf0dxbmh4BlnNrikuqBfD7uB/Na6W98E8uH3FX3nWV9mi59IlzIM208PFw9YlqiyDV5K5FBkKQSNSxz0ETYf+DoMd+nmNgA/KUwDSyGNZdSWoHS5bMCVnkjCzZ8iW/i7KOKvYlgvlMbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708396090; c=relaxed/simple; bh=g19aHEmjFQ5tSUUNdPZtI2asKF0wN+dEKgAolGDccIo=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=jfsZ3t3U7XDQd5pVUENC2vGMFSbc3SjolkKCWIp7rDn9ln7gAFArB137TbQlD9LNq+/V/PmQDtT68cbsIxZDTiI5sjR3NA1QVTrdN10k+tJbYOAFO7W9Vog85JJ14prIDVpO5bsgVhiT6rJX8N1X3UcPOTz40mpYSXMX7DF1ing= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=ltWv/YZq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB511C433F1; Tue, 20 Feb 2024 02:28:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1708396090; bh=g19aHEmjFQ5tSUUNdPZtI2asKF0wN+dEKgAolGDccIo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=ltWv/YZqIm7Ia0akbwKFqWLV83KaIHAYNaIacwP1NBARaD8lrJCVtwtg0c68+w24W jOKItH+DtztnP7owYaHqcDtXAK17W5jcR83LJ7h6pTn7cDNLqu4ofWGkLZ8zvlo8oS 5j4V0FS5Q/0Ui5x/QbbdkrdBv6g9SHDMbxV1l7FQ= Date: Mon, 19 Feb 2024 18:28:08 -0800 From: Andrew Morton To: Luis Chamberlain Cc: willy@infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, gost.dev@samsung.com, p.raghav@samsung.com, da.gomez@samsung.com, kernel test robot Subject: Re: [PATCH] test_xarray: fix soft lockup for advanced-api tests Message-Id: <20240219182808.726500bf3546b49ac05d98d4@linux-foundation.org> In-Reply-To: <20240216194329.840555-1-mcgrof@kernel.org> References: <20240216194329.840555-1-mcgrof@kernel.org> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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-Transfer-Encoding: 7bit On Fri, 16 Feb 2024 11:43:29 -0800 Luis Chamberlain wrote: > The new adanced API tests So this is a fix against the mm-unstable series "test_xarray: advanced API multi-index tests", v2. > want to vet the xarray API is doing what it > promises by manually iterating over a set of possible indexes on its > own, and using a query operation which holds the RCU lock and then > releases it. So it is not using the helper loop options which xarray > provides on purpose. Any loop which iterates over 1 million entries > (which is possible with order 20, so emulating say a 4 GiB block size) > to just to rcu lock and unlock will eventually end up triggering a soft > lockup on systems which don't preempt, and have lock provin and RCU > prooving enabled. > > xarray users already use XA_CHECK_SCHED for loops which may take a long > time, in our case we don't want to RCU unlock and lock as the caller > does that already, but rather just force a schedule every XA_CHECK_SCHED > iterations since the test is trying to not trust and rather test that > xarray is doing the right thing. > > [0] https://lkml.kernel.org/r/202402071613.70f28243-lkp@intel.com > > Reported-by: kernel test robot As the above links shows, this should be Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-lkp/202402071613.70f28243-lkp@intel.com > --- a/lib/test_xarray.c > +++ b/lib/test_xarray.c > @@ -781,6 +781,7 @@ static noinline void *test_get_entry(struct xarray *xa, unsigned long index) > { > XA_STATE(xas, xa, index); > void *p; > + static unsigned int i = 0; I don't think this needs static storage. PetPeeve: it is unexpected that `i' has unsigned type. Can a more communicative identifier be used? I shall queue your patch as a fixup patch against test_xarray-add-tests-for-advanced-multi-index-use and shall add the below on top. Pleae check. --- a/lib/test_xarray.c~test_xarray-fix-soft-lockup-for-advanced-api-tests-fix +++ a/lib/test_xarray.c @@ -728,7 +728,7 @@ static noinline void *test_get_entry(str { XA_STATE(xas, xa, index); void *p; - static unsigned int i = 0; + unsigned int loops = 0; rcu_read_lock(); repeat: @@ -746,7 +746,7 @@ repeat: * APIs won't be stupid, proper page cache APIs loop over the proper * order so when using a larger order we skip shared entries. */ - if (++i % XA_CHECK_SCHED == 0) + if (++loops % XA_CHECK_SCHED == 0) schedule(); return p; _