lkml.org 
[lkml]   [2018]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] efivarfs: Limit the rate for non-root to read files
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 as expected:

$ dd if=DefSetup-e8a99903-302c-4851-a6be-ab2731873b2f of=/dev/null bs=1
^C301+0 records in
300+0 records out
300 bytes copied, 3.10487 s, 0.1 kB/s


> and gives nice warnings too?

They seemed very spammy before so I turned them off with this:

+ ratelimit_set_flags(&new->ratelimit, RATELIMIT_MSG_ON_RELEASE);

They looked like this:

[ 176.607182] efivarfs_file_read: 42 callbacks suppressed
[ 177.611064] efivarfs_file_read: 42 callbacks suppressed
[ 178.614931] efivarfs_file_read: 41 callbacks suppressed
[ 179.622986] efivarfs_file_read: 42 callbacks suppressed
[ 180.630920] efivarfs_file_read: 42 callbacks suppressed
[ 181.634839] efivarfs_file_read: 42 callbacks suppressed
[ 182.646729] efivarfs_file_read: 42 callbacks suppressed
[ 183.658679] efivarfs_file_read: 42 callbacks suppressed
[ 184.678664] efivarfs_file_read: 43 callbacks suppressed
[ 185.698571] efivarfs_file_read: 43 callbacks suppressed
[ 186.703129] efivarfs_file_read: 42 callbacks suppressed
[ 187.718510] efivarfs_file_read: 43 callbacks suppressed

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 something
stupid and we should drop that line from the patch and let the
warnings flow?

-Tony

\
 
 \ /
  Last update: 2018-02-22 18:55    [W:0.096 / U:0.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site