kernel_optimize_test/include
Uladzislau Rezki (Sony) 1835f475e3 rcu: Introduce single argument kvfree_rcu() interface
Make kvfree_rcu() capable of freeing objects that will not
embed an rcu_head within it. This saves storage overhead in
such objects. Reclaiming headless objects this way requires
only a single argument (pointer to the object).

After this patch, there are two ways to use kvfree_rcu():

a) kvfree_rcu(ptr, rhf);
    struct X {
        struct rcu_head rhf;
        unsigned char data[100];
    };

    void *ptr = kvmalloc(sizeof(struct X), GFP_KERNEL);
    if (ptr)
        kvfree_rcu(ptr, rhf);

b) kvfree_rcu(ptr);
    void *ptr = kvmalloc(some_bytes, GFP_KERNEL);
    if (ptr)
        kvfree_rcu(ptr);

Note that the headless usage (example b) can only be used in a code
that can sleep. This is enforced by the CONFIG_DEBUG_ATOMIC_SLEEP
option.

Co-developed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Reviewed-by: Joel Fernandes (Google) <joel@joelfernandes.org>
Signed-off-by: Uladzislau Rezki (Sony) <urezki@gmail.com>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
2020-06-29 11:59:26 -07:00
..
acpi
asm-generic make asm-generic/cacheflush.h more standalone 2020-06-26 00:27:37 -07:00
clocksource
crypto
drm drm/edid: Replace zero-length array with flexible-array 2020-06-15 23:08:31 -05:00
dt-bindings
keys RxRPC: Replace zero-length array with flexible-array 2020-06-15 23:08:32 -05:00
kunit
kvm
linux rcu: Introduce single argument kvfree_rcu() interface 2020-06-29 11:59:26 -07:00
math-emu
media
misc
net sctp: Don't advertise IPv4 addresses if ipv6only is set on the socket 2020-06-25 16:11:33 -07:00
pcmcia
ras
rdma
scsi
soc
sound ASoC: Fixes for v5.8 2020-06-22 13:49:14 +02:00
target
trace rcu: Rename *_kfree_callback/*_kfree_rcu_offset/kfree_call_* 2020-06-29 11:59:25 -07:00
uapi VFIO fixes for v5.8-rc3 2020-06-27 15:17:21 -07:00
vdso
video
xen