mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger@applied-asynchrony.com>
To: linux-kernel@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] btrfs: limit async_work allocation and worker func duration
Date: Mon, 12 Dec 2016 16:33:46 +0000 (UTC)	[thread overview]
Message-ID: <pan$e49b8$c61936e5$aa6f2b4b$cc1c2092@applied-asynchrony.com> (raw)
In-Reply-To: <20161212145443.GT12522@twin.jikos.cz>

On Mon, 12 Dec 2016 15:54:43 +0100, David Sterba wrote:

> On Fri, Dec 02, 2016 at 05:51:36PM -0800, Maxim Patlasov wrote:
>> Problem statement: unprivileged user who has read-write access to more than
>> one btrfs subvolume may easily consume all kernel memory (eventually
>> triggering oom-killer).
>> 
[..snip..]
>>  
>> +bool btrfs_workqueue_normal_congested(struct btrfs_workqueue *wq)
>> +{
>> +	int thresh = wq->normal->thresh != NO_THRESHOLD ?
>> +		wq->normal->thresh : num_possible_cpus();
> 
> Why not num_online_cpus? I vaguely remember we should be checking online
> cpus, but don't have the mails for reference. We use it elsewhere for

+1

> spreading the work over cpus, but it's still not bullet proof regarding
> cpu onlining/offlining.
> 
> Otherwise looks good to me, as far as I can imagine the possible
> behaviour of the various async parameters just from reading the code.

If it's any help I have been running with this for a few days now; regular
day-to-day work, snapshots, balancing, defrags etc. with no obvious
problems, though I haven't tried to break it with the reproducer either.
Anyway:

Tested-by: Holger Hoffstätte <holger@applied-asynchrony.com>

cheers,
Holger

  reply	other threads:[~2016-12-12 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-03  1:51 Maxim Patlasov
2016-12-12 14:54 ` David Sterba
2016-12-12 16:33   ` Holger Hoffstätte [this message]
2016-12-12 20:35   ` Maxim Patlasov
2016-12-13 19:03     ` Chris Mason

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='pan$e49b8$c61936e5$aa6f2b4b$cc1c2092@applied-asynchrony.com' \
    --to=holger@applied-asynchrony.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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

Powered by JetHome