From: Bojan Smojver <bojan@rexursive.com>
To: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>
Subject: Re: [PATCH v5]: Improve performance of LZO hibernation
Date: Wed, 28 Sep 2011 17:29:07 +1000 [thread overview]
Message-ID: <1317194947.1998.18.camel@shrek.rexursive.com> (raw)
In-Reply-To: <CAOJsxLGam5htmwtTZOuPka02+CZ1Fkv1b+SuYMJ8x9VRntFzRQ@mail.gmail.com>
On Wed, 2011-09-28 at 10:22 +0300, Pekka Enberg wrote:
> > + while(1) {
> > + wait_event(d->go, atomic_read(&d->ready) ||
> > + kthread_should_stop());
> > + if (kthread_should_stop())
> > + break;
>
> So... what happens to the hibernation process when 'kthread_should_stop()'
> returns true?
The compression/decompression threads stop by breaking out of the loop.
At least they should, right? Did I misread some docs here?
PS. I'm not really a kernel programmer, so I'm kinda stumbling my way
through all this.
> > + nthr = num_online_cpus() - 1;
> > + nthr = nthr > LZO_THREADS ? LZO_THREADS : (nthr < 1 ? 1 : nthr);
>
> That's probably one of the most unreadable uses of the ternary
> operator I've ever seen!
Sorry about that. I can simplify.
> What's going on here anyway? Why "num_online_cpus() - 1"? What's wrong with
>
> nr_threads = num_online_cpus();
> if (nr_threads > LZO_THREADS)
> nr_threads = LZO_THREADS;
We want to keep at least one CPU free for that I/O and for pulling the
other threads into sync when they are done (that is if we have more than
one), right?
> [ And yes, please use less cryptic variable names. ]
OK, been pulled over for that before. Will fix.
> Overall, I really like your patch!
Thanks, hopefully it doesn't blow up too many file systems :-)
--
Bojan
next prev parent reply other threads:[~2011-09-28 7:29 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-28 4:20 [PATCH v5]: Improve performance of LZO hibernation Bojan Smojver
2011-09-28 7:14 ` Pekka Enberg
2011-09-28 7:18 ` Bojan Smojver
2011-09-28 7:25 ` Pekka Enberg
2011-09-28 7:22 ` Pekka Enberg
2011-09-28 7:29 ` Bojan Smojver [this message]
2011-09-28 7:48 ` Pekka Enberg
2011-09-28 7:54 ` Bojan Smojver
2011-09-28 13:02 ` Pekka Enberg
2011-09-28 13:18 ` Bojan Smojver
2011-09-29 8:23 ` Bojan Smojver
2011-09-28 7:57 ` Bojan Smojver
2011-09-28 8:00 ` Bojan Smojver
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=1317194947.1998.18.camel@shrek.rexursive.com \
--to=bojan@rexursive.com \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=rjw@sisk.pl \
/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