mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Luis Chamberlain <mcgrof@kernel.org>
Cc: kernel test robot <oliver.sang@intel.com>,
	Daniel Gomez <da.gomez@samsung.com>,
	oe-lkp@lists.linux.dev, lkp@intel.com,
	linux-kernel@vger.kernel.org,
	"gost.dev@samsung.com" <gost.dev@samsung.com>,
	Pankaj Raghav <p.raghav@samsung.com>
Subject: Re: [PATCH 1/2] test_xarray: add tests for advanced multi-index use
Date: Fri, 26 Jan 2024 19:26:17 +0000	[thread overview]
Message-ID: <ZbQHWf0Hh04OwoZx@casper.infradead.org> (raw)
In-Reply-To: <ZbQEA6WIh0HrFTbP@bombadil.infradead.org>

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);
        }


  reply	other threads:[~2024-01-26 19:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20231104005750eucas1p11bb8d7b203f8376aacd097a713f35734@eucas1p1.samsung.com>
2023-11-04  0:57 ` [PATCH 0/2] XArray multi-index tests Daniel Gomez
     [not found]   ` <CGME20231104005753eucas1p19e4ec0196f5ea297f59fb86b2a648b53@eucas1p1.samsung.com>
2023-11-04  0:57     ` [PATCH 1/2] test_xarray: add tests for advanced multi-index use Daniel Gomez
2023-11-15 15:02       ` kernel test robot
2023-11-17 20:54         ` Luis Chamberlain
2023-11-17 20:58           ` Matthew Wilcox
2023-11-17 21:01             ` Luis Chamberlain
2024-01-26 19:12               ` Luis Chamberlain
2024-01-26 19:26                 ` Matthew Wilcox [this message]
2024-01-26 20:04                   ` Luis Chamberlain
2024-01-26 20:32                     ` Matthew Wilcox
2024-01-31 21:58                       ` Luis Chamberlain
2024-02-15  2:15                       ` Luis Chamberlain
     [not found]   ` <CGME20231104005753eucas1p161414dd7c5eb9cdc6863fb543459c242@eucas1p1.samsung.com>
2023-11-04  0:57     ` [PATCH 2/2] XArray: add cmpxchg order test Daniel Gomez
     [not found]   ` <CGME20231104010041eucas1p2369aea5ef1182bea53989b43ea07049e@eucas1p2.samsung.com>
2023-11-04  1:00     ` [PATCH 0/2] XArray multi-index tests Daniel Gomez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZbQHWf0Hh04OwoZx@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=da.gomez@samsung.com \
    --cc=gost.dev@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mcgrof@kernel.org \
    --cc=oe-lkp@lists.linux.dev \
    --cc=oliver.sang@intel.com \
    --cc=p.raghav@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®