Re: [PATCH v2 bpf-next] bpf: use raw_spin_trylock() for pcpu_freelist_push/pop in NMI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/5/20 8:03 PM, Martin KaFai Lau wrote:
On Mon, Oct 05, 2020 at 09:58:38AM -0700, Song Liu wrote:
[...]
non-NMI pop(): 	use _lock(); check per cpu lists first;
                 if all per cpu lists are empty, check extralist;
                 if extralist is empty, return NULL.

non-NMI push(): use _lock(); only push to per cpu lists.

NMI pop():    use _trylock(); check per cpu lists first;
               if all per cpu lists are locked or empty, check extralist;
               if extralist is locked or empty, return NULL.

NMI push():   use _trylock(); check per cpu lists first;
               if all per cpu lists are locked; try push to extralist;
               if extralist is also locked, keep trying on per cpu lists.

Reported-by: Alexei Starovoitov <ast@xxxxxxxxxx>
Signed-off-by: Song Liu <songliubraving@xxxxxx>

---
Changes v1 => v2:
1. Update commit log. (Daniel)
Acked-by: Martin KaFai Lau <kafai@xxxxxx>

LGTM, applied, thanks!



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux