lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <86F51957-F67D-411A-A790-B4255C617F85@fb.com>
Date:   Mon, 21 Dec 2020 20:54:48 +0000
From:   Song Liu <songliubraving@...com>
To:     Eric Dumazet <eric.dumazet@...il.com>
CC:     Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        "David S . Miller" <davem@...emloft.net>,
        netdev <netdev@...r.kernel.org>,
        Eric Dumazet <edumazet@...gle.com>, bpf <bpf@...r.kernel.org>,
        John Sperbeck <jsperbeck@...gle.com>
Subject: Re: [PATCH bpf] bpf: add schedule point in htab_init_buckets()



> On Dec 21, 2020, at 11:25 AM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> 
> From: Eric Dumazet <edumazet@...gle.com>
> 
> We noticed that with a LOCKDEP enabled kernel,
> allocating a hash table with 65536 buckets would
> use more than 60ms.
> 
> htab_init_buckets() runs from process context,
> it is safe to schedule to avoid latency spikes.
> 
> Fixes: c50eb518e262 ("bpf: Use separate lockdep class for each hashtab")
> Signed-off-by: Eric Dumazet <edumazet@...gle.com>
> Reported-By: John Sperbeck <jsperbeck@...gle.com>
> Cc: Song Liu <songliubraving@...com>

Acked-by: Song Liu <songliubraving@...com>

Thanks for the fix!

> ---
> kernel/bpf/hashtab.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
> index 7e848200cd268a0f9ed063f0b641d3c355787013..c1ac7f964bc997925fd427f5192168829d812e5d 100644
> --- a/kernel/bpf/hashtab.c
> +++ b/kernel/bpf/hashtab.c
> @@ -152,6 +152,7 @@ static void htab_init_buckets(struct bpf_htab *htab)
> 			lockdep_set_class(&htab->buckets[i].lock,
> 					  &htab->lockdep_key);
> 		}
> +		cond_resched();
> 	}
> }
> 
> -- 
> 2.29.2.729.g45daf8777d-goog
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ