[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 12 Dec 2016 16:33:46 +0000 (UTC)
From: Holger Hoffstätte
<holger@...lied-asynchrony.com>
To: linux-kernel@...r.kernel.org
Cc: linux-btrfs@...r.kernel.org
Subject: Re: [PATCH] btrfs: limit async_work allocation and worker func
duration
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@...lied-asynchrony.com>
cheers,
Holger
Powered by blists - more mailing lists