Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-13 Thread Chris Mason
On 12/12/2016 03:35 PM, Maxim Patlasov wrote: On 12/12/2016 06:54 AM, David Sterba wrote: As far as we don't have any NO_THRESHOLD users of btrfs_workqueue_normal_congested for now, I tend to think it's better to add a descriptive comment and simply return "false" from

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-13 Thread Chris Mason
On 12/12/2016 03:35 PM, Maxim Patlasov wrote: On 12/12/2016 06:54 AM, David Sterba wrote: As far as we don't have any NO_THRESHOLD users of btrfs_workqueue_normal_congested for now, I tend to think it's better to add a descriptive comment and simply return "false" from

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
On 12/12/2016 06:54 AM, 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). Reproducer

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Maxim Patlasov
On 12/12/2016 06:54 AM, 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). Reproducer

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Holger Hoffstätte
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

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread Holger Hoffstätte
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

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread David Sterba
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). > > Reproducer (./mkrmdir below essentially loops over

Re: [PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-12 Thread David Sterba
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). > > Reproducer (./mkrmdir below essentially loops over

[PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-02 Thread Maxim Patlasov
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). Reproducer (./mkrmdir below essentially loops over mkdir/rmdir): [root@kteam1 ~]# cat prep.sh DEV=/dev/sdb mkfs.btrfs -f $DEV

[PATCH] btrfs: limit async_work allocation and worker func duration

2016-12-02 Thread Maxim Patlasov
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). Reproducer (./mkrmdir below essentially loops over mkdir/rmdir): [root@kteam1 ~]# cat prep.sh DEV=/dev/sdb mkfs.btrfs -f $DEV