linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: Sergey Senozhatsky <senozhatsky@chromium.org>,
	 Andrew Morton <akpm@linux-foundation.org>,
	Minchan Kim <minchan@kernel.org>,
	 Brian Geffon <bgeffon@google.com>, Jens Axboe <axboe@kernel.dk>,
	linux-kernel@vger.kernel.org,  linux-block@vger.kernel.org,
	linux-mm@kvack.org, Richard Chang <richardycc@google.com>,
	 David Stevens <stevensd@google.com>
Subject: Re: [PATCH] zram: drop slot trylock and miss_free
Date: Wed, 11 Feb 2026 12:07:31 +0900	[thread overview]
Message-ID: <d2wp2s3jj4lm6shynryqwkvamyrpn3g5larn6z3yeyplel6by4@5ew3ii7v5sjz> (raw)
In-Reply-To: <aYtAz5vQTod7DXqV@casper.infradead.org>

On (26/02/10 14:29), Matthew Wilcox wrote:
> On Tue, Feb 10, 2026 at 12:50:37PM +0900, Sergey Senozhatsky wrote:
> > @@ -1943,15 +1927,9 @@ static ssize_t debug_stat_show(struct device *dev,
> >  {
> >  	int version = 1;
> >  	struct zram *zram = dev_to_zram(dev);
> > -	ssize_t ret;
> >  
> >  	guard(rwsem_read)(&zram->dev_lock);
> > -	ret = sysfs_emit(buf,
> > -			"version: %d\n0 %8llu\n",
> > -			version,
> > -			(u64)atomic64_read(&zram->stats.miss_free));
> > -
> > -	return ret;
> > +	return sysfs_emit(buf, "version: %d\n0 0\n", version);
> >  }
> 
> You don't need the dev_lock any more to just report the version.

True.  I'll think if I want to send out a v2 with just miss_free
removal.  The objective was to remove trylock (and all the things
around it), but trylock has to stay.  While we cannot have

	slot_lock(42)
	<IRQ>
	slot_lock(42)

any more, the slot-free-notify is still called under spin_lock, and
slot_lock() might_sleep().  So trylock has to stay around.

> And should the version be changed now that you've changed the format to
> not include miss_free?

The idea was to bump the version only when the format changes.  You
normally (well, technically "always", since e914d8f00391) would see
0 miss_free, and with the patch it's just a hard-coded 0.

Thanks for taking a look, Matthew.


      reply	other threads:[~2026-02-11  3:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-10  3:50 Sergey Senozhatsky
2026-02-10  4:10 ` Sergey Senozhatsky
2026-02-10 14:29 ` Matthew Wilcox
2026-02-11  3:07   ` Sergey Senozhatsky [this message]

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=d2wp2s3jj4lm6shynryqwkvamyrpn3g5larn6z3yeyplel6by4@5ew3ii7v5sjz \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=axboe@kernel.dk \
    --cc=bgeffon@google.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=richardycc@google.com \
    --cc=stevensd@google.com \
    --cc=willy@infradead.org \
    /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