From: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org,
Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Subject: Re: [PATCH] zram: export the number of available comp streams
Date: Wed, 27 Jan 2016 09:34:56 +0900 [thread overview]
Message-ID: <20160127003456.GA1612@swordfish> (raw)
In-Reply-To: <20160126131332.562f0984818b9d07b6c2b21c@linux-foundation.org>
On (01/26/16 13:13), Andrew Morton wrote:
[..]
> > +`avail_streams' column shows the current number of available compression
> > +streams, which is not necessarily equal to the number of max compression
> > +streams. The number of max compression streams can be set too high and be
> > +unreachable (depending on the load and the usage pattern, of course).
> > +`avail_streams' let to find out the real 'level of concurrency' that
> > +a particular zram device saw and to calculate the real memory consumption
> > +by allocated compression streams, not the theoretical maximum value.
> >
>
> "number of max compression streams" doesn't make a lot of sense. It
> should be "max number of compression streams", yes"
Thank you! much better this way.
[..]
> > +static int zcomp_strm_multi_num_avail_streams(struct zcomp *comp)
> > +{
> > + int avail;
> > + struct zcomp_strm_multi *zs = comp->stream;
> > +
> > + spin_lock(&zs->strm_lock);
> > + avail = zs->avail_strm;
> > + spin_unlock(&zs->strm_lock);
> > +
> > + return avail;
> > +}
>
> The spin_lock() doesn't do anything very useful here - we're simply
> reading an `int' and it could be omitted. I guess it's OK for
> documentary reasons (and perhaps for the memory barrier).
yes, agree, that was exactly my thinking. it's fine to have it here
for barrier, but at the same it can be scratched and replaced with
a "yes, this is racy. don't send a patch. `avail_streams' is not so
important" comment.
let's hear from Minchan, if he hates it then I'll just send a v2.
-ss
next prev parent reply other threads:[~2016-01-27 0:33 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-26 12:03 [PATCH] zram: export the number of available comp streams Sergey Senozhatsky
2016-01-26 21:13 ` Andrew Morton
2016-01-27 0:34 ` Sergey Senozhatsky [this message]
2016-01-29 7:28 ` Minchan Kim
2016-02-01 1:02 ` Sergey Senozhatsky
2016-03-18 0:32 ` Minchan Kim
2016-03-18 1:09 ` Sergey Senozhatsky
2016-03-18 1:25 ` Minchan Kim
2016-03-21 7:51 ` Sergey Senozhatsky
2016-03-22 0:39 ` Minchan Kim
2016-03-23 8:01 ` Sergey Senozhatsky
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=20160127003456.GA1612@swordfish \
--to=sergey.senozhatsky.work@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=sergey.senozhatsky@gmail.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