Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp868036rdb; Fri, 26 Jan 2024 13:20:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IFsANdylQai1+R6JrU/cdJsW0VFHEtrl+D7YE3yOksxsG9wY2QBVbUpHzxH3zR6XslK101f X-Received: by 2002:ac8:7c4b:0:b0:42a:857d:3bc6 with SMTP id o11-20020ac87c4b000000b0042a857d3bc6mr516853qtv.33.1706304018204; Fri, 26 Jan 2024 13:20:18 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706304018; cv=pass; d=google.com; s=arc-20160816; b=VPwIqedzyGTkZH7xQXW5505o3weSSWHsUeASGINy/c738Wz6EzHZLX7VtiJP3x8t+c xqPRB8204jjhBWO9MMAGmHUw0V3xBc/L901wPa/WdZ0GG+bP75UZ+Y0PgIhqgsqFAMXZ 7JccHJpij+t5Gb/PW2o62aGp9qMMEqSJk0ONyr0laSgQrdu/yxzeydmK7JB/WdswWn7s KZ+VP0FYBpuEbjzY5vfWFDl6J5qp7XAO5R79WlQIby2P3sF9OxKrdlNvBQ3m3lryVUyb bAi/vA3lNGHUML1SDxJDL1WsPBr7VCnJ6GDjsFZuXdkg8TAfNHE0o6TJ8Gj2e7QQ11f2 TsGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=jnmyjvSQEp/q0Ynx/vobufARP3No6TCftfqQmRh9fMk=; fh=nC2BLW+MHc0sFEX4vyII2Pl1xvtLLTzMNPFtE7/UtqE=; b=q5GKJQrXi3HHBXQ5jzE6Q9DPOZXj01TCxWjpVO/gN7NuW8Eh0Qr4jHIri5cFAKICJR pP/YBaTIPEK5IslacM1ZtxYR2a+jIbfGByZubT6sBCnjw4MmDYabNIgJSDwyM7GRRkUQ r7EnJ53VYTt0OsuqCQoN8VNaQA112MENQpq57ld9Jgp0/aCuIvsO42dzWpinqTQb4lF2 +QmplVi2pAw7m1FU6Kh4YgHybAH1HayKm34WV3WczvzlEblYrEcc2rpzLnsBgQUyBJhN xFOy/N+3/azIXmuDXeoppVW0Xgo5qpdm6sxS+83zYP0tCJzlwo5pXhOzpvo2a+RicEoF Pcmw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Il1IIDZV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-40604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40604-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id o13-20020a05622a138d00b0042a7a1f95ddsi2074061qtk.721.2024.01.26.13.20.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 13:20:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=Il1IIDZV; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-40604-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40604-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 7007A1C24099 for ; Fri, 26 Jan 2024 20:05:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5E59022F1E; Fri, 26 Jan 2024 20:04:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Il1IIDZV" Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 B8BE622627; Fri, 26 Jan 2024 20:04:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.137.202.133 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706299486; cv=none; b=kGyGXlcnXECVwh1pFXhuKm4kjlw/quDacPS1BEJWyyQMJbuUYQIHAoJfzeUN7s8OWQE2HK8MKblFcnTS/C7DNUMwHqNdyUdwGwKpbcpqB0sNTBpxcakpGSyz5R/+eUmpK8N+GHOxF0hB6PPqiprhJ6Ki3pXlfx0SV5SHUP+rzKc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706299486; c=relaxed/simple; bh=ccMl1PBgz/NjqHuJ3/eVNttfjTwPLda4GTqEe0hDckI=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cfjp16J+kxxMFMOHBkcsYiMuHClY/oX8Y1OPA76sut+NvRfLHV8cCBS+ae2uXKbPKIDNiM21yKjmYamT/Pzl4VUUWiNnQCNwL54BXQeLT7BeDaj0jltObn3/WoaGNOI35pc87NPG7tzwDX/6N9E4EwW60OCjjUTv8yRaNXwrJlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Il1IIDZV; arc=none smtp.client-ip=198.137.202.133 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=jnmyjvSQEp/q0Ynx/vobufARP3No6TCftfqQmRh9fMk=; b=Il1IIDZVBS/VzUt1WtD259RrFI 8MtFMppx7LpmljStyWkBjpRUCfi92AfoBvWG9c+I5TzsWH3ZtNjOu0f6Je4+13YeieRvZa+4VH6nD D7WV05AGGwWgBvsYNeSYe+SHXFf/kK2iB7+82vwjHk1TcZ09gEY5iGZErvn2JH5FF0HP4pGUfFXib 509XCEb8DkYbFt5kfrPfeVl+IEYn3xq4BgfpOOW2BAmGJePJ24+FwoODa/wJWn0xZVI7Pe0PpJ9mA GB7syuG1ClK8Jy0LBb5lsEGzB1SqrozsONGhzbiVq4sS7z9dDnClx1KWM6KdEbkXUJqO9BJdpCaTz pJXkvuyw==; Received: from mcgrof by bombadil.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTSRQ-00000005Jol-1izF; Fri, 26 Jan 2024 20:04:44 +0000 Date: Fri, 26 Jan 2024 12:04:44 -0800 From: Luis Chamberlain To: Matthew Wilcox Cc: kernel test robot , Daniel Gomez , oe-lkp@lists.linux.dev, lkp@intel.com, linux-kernel@vger.kernel.org, "gost.dev@samsung.com" , Pankaj Raghav Subject: Re: [PATCH 1/2] test_xarray: add tests for advanced multi-index use Message-ID: References: <20231104005747.1389762-2-da.gomez@samsung.com> <202311152254.610174ff-oliver.sang@intel.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: Sender: Luis Chamberlain On Fri, Jan 26, 2024 at 07:26:17PM +0000, Matthew Wilcox wrote: > On Fri, Jan 26, 2024 at 11:12:03AM -0800, Luis Chamberlain wrote: > > On Fri, Nov 17, 2023 at 01:01:18PM -0800, Luis Chamberlain wrote: > > > On Fri, Nov 17, 2023 at 08:58:05PM +0000, Matthew Wilcox wrote: > > > > On Fri, Nov 17, 2023 at 12:54:09PM -0800, Luis Chamberlain wrote: > > > > > +/* > > > > > + * Can be used in contexts which busy loop on large number of entries but can > > > > > + * sleep and timing is if no importance to test correctness. > > > > > + */ > > > > > +#define XA_BUG_ON_RELAX(xa, x) do { \ > > > > > + if ((tests_run % 1000) == 0) \ > > > > > + schedule(); \ > > > > > + XA_BUG_ON(xa, x); \ > > > > > +} while (0) > > > > > > > > That is awful. Please don't do that. You're mixing two completely > > > > unrelated thing into the same macro, which makes no sense. Not only > > > > that, it's a macro which refers to something in the containing > > > > environment that isn't a paramter to the macro. > > > > > > I figured you'd puke. Would you prefer I just open code the check on the loop > > > though? I'm sure another alternative is we *not care* about these > > > overloaded systems running the test. What would you prefer? > > > > OK without any particular preferences outlined this is what I have, > > splitting the two contexts and making the busy loop fix clearer. > > > > +#define XA_BUSY_LOOP_RELAX(xa, x) do { \ > > + if ((i % 1000) == 0) \ > > + schedule(); \ > > +} while (0) > > + > > +/* > > + * Can be used in contexts which busy loop on large number of entries but can > > + * sleep and timing is if no importance to test correctness. > > + */ > > +#define XA_BUG_ON_RELAX(i, xa, x) do { \ > > + XA_BUSY_LOOP_RELAX(i); \ > > + XA_BUG_ON(xa, x); \ > > +} while (0) > > No. XA_BUG_ON_RELAX is not OK. Really. > > We have a perfectly good system for "relaxing": > > xas_for_each_marked(&xas, page, end, PAGECACHE_TAG_DIRTY) { > xas_set_mark(&xas, PAGECACHE_TAG_TOWRITE); > if (++tagged % XA_CHECK_SCHED) > continue; > > xas_pause(&xas); > xas_unlock_irq(&xas); > cond_resched(); > xas_lock_irq(&xas); > } And yet we can get a soft lockup with order 20 (1,048,576 entries), granted busy looping over 1 million entries is insane, but it seems it the existing code may not be enough to avoid the soft lockup. Also cond_resched() may be eventually removed [0]. Anyway, we can ignore the soft lockup then. [0] https://lwn.net/Articles/950581/ Luis