Re: [PATCH v2] efivarfs: Limit the rate for non-root to read files

2018-02-23 Thread Andy Lutomirski
On Thu, Feb 22, 2018 at 6:08 PM, Ard Biesheuvel wrote: > On 22 February 2018 at 18:07, Linus Torvalds > wrote: >> On Thu, Feb 22, 2018 at 9:54 AM, Luck, Tony wrote: >>> With the new "while/nap" change there would still be one message >>> per second, but the number of callbacks suppressed should

Re: [PATCH v2] efivarfs: Limit the rate for non-root to read files

2018-02-22 Thread Ard Biesheuvel
On 22 February 2018 at 18:07, Linus Torvalds wrote: > On Thu, Feb 22, 2018 at 9:54 AM, Luck, Tony wrote: >> With the new "while/nap" change there would still be one message >> per second, but the number of callbacks suppressed should be 1 >> (unless the user has many threads doing reads). >> >> M

Re: [PATCH v2] efivarfs: Limit the rate for non-root to read files

2018-02-22 Thread Linus Torvalds
On Thu, Feb 22, 2018 at 9:54 AM, Luck, Tony wrote: > With the new "while/nap" change there would still be one message > per second, but the number of callbacks suppressed should be 1 > (unless the user has many threads doing reads). > > Maybe it is good to know that an application is doing somethi

Re: [PATCH v2] efivarfs: Limit the rate for non-root to read files

2018-02-22 Thread Luck, Tony
On Thu, Feb 22, 2018 at 09:39:10AM -0800, Linus Torvalds wrote: > I'm certainly ok with this. I'm assuming this has been tested I read some files using "dd bs=1" as root and non-root. Root still goes fast, non-root is limited. Both see the same data. I can ^C the non-root version and the dd quits

Re: [PATCH v2] efivarfs: Limit the rate for non-root to read files

2018-02-22 Thread Linus Torvalds
On Thu, Feb 22, 2018 at 9:15 AM, Luck, Tony wrote: > > In efivarfs if the limit is exceeded when reading, we take an > interruptible nap for 50ms and check the rate limit again. Ok, turning that 'if' into a 'while' makes the sleeping work even in the presence of lots of threads, and that all look