Thread (13 messages) flat view 13 messages, 3 authors, 2022-01-20

Re: [PATCH v4 bpf-next 2/7] bpf: use bytes instead of pages for bpf_jit_[charge|uncharge]_modmem

From: Song Liu <hidden>
Date: 2022-01-20 04:45:31
Also in: bpf, lkml

On Jan 19, 2022, at 8:10 PM, Alexei Starovoitov [off-list ref] wrote:

On Wed, Jan 19, 2022 at 03:06:15PM -0800, Song Liu wrote:
quoted
From: Song Liu <redacted>

This enables sub-page memory charge and allocation.

Signed-off-by: Song Liu <redacted>
[...]
quoted
@@ -808,7 +808,7 @@ int bpf_jit_add_poke_descriptor(struct bpf_prog *prog,
	return slot;
}

-static atomic_long_t bpf_jit_current;
+static atomic64_t bpf_jit_current;
I don't understand the motivation for this change.
bpf_jit_limit is type "long" and it's counting in bytes.
So why change jit_current to atomic64?
atomic_long will be fine even on 32-bit arch.
What did I miss?
Hmm.. I think you are right. I guess I missed the fact that we use
long bpf_jit_limit. Will remove this change in the next version. 

Thanks,
Song
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help