[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a73e4e66b8a541d7bf74fe8a66ebbc6a@AcuMS.aculab.com>
Date: Wed, 16 Dec 2020 10:38:56 +0000
From: David Laight <David.Laight@...LAB.COM>
To: 'Alexei Starovoitov' <alexei.starovoitov@...il.com>,
Cong Wang <xiyou.wangcong@...il.com>
CC: Daniel Borkmann <daniel@...earbox.net>,
Andrii Nakryiko <andrii.nakryiko@...il.com>,
Networking <netdev@...r.kernel.org>, bpf <bpf@...r.kernel.org>,
Cong Wang <cong.wang@...edance.com>,
"Alexei Starovoitov" <ast@...nel.org>,
Dongdong Wang <wangdongdong.6@...edance.com>
Subject: RE: [Patch bpf-next v2 2/5] bpf: introduce timeout map
From: Alexei Starovoitov
> Sent: 16 December 2020 02:36
...
> > The problem is never about granularity, it is about how efficient we can
> > GC. User-space has to scan the whole table one by one, while the kernel
> > can just do this behind the scene with a much lower overhead.
> >
> > Let's say we arm a timer for each entry in user-space, it requires a syscall
> > and locking buckets each time for each entry. Kernel could do it without
> > any additional syscall and batching. Like I said above, we could have
> > millions of entries, so the overhead would be big in this scenario.
>
> and the user space can pick any other implementation instead
> of trivial entry by entry gc with timer.
The kernel can also gc entries when scanning hash lists during insert
(or even during lookup if not using rw locks).
Apart from the memory use there isn't really a problem having timed-out
entries in the hash table if nothing is looking at them.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
Powered by blists - more mailing lists