[DRBD-user] [PATCH] tree wide: Use kvfree() than conditional kfree()/vfree()

David Rientjes rientjes at google.com
Thu Nov 19 01:23:37 CET 2015

Note: "permalinks" may not be as permanent as we would like,
direct links of old sources may well be a few messages off.


On Mon, 9 Nov 2015, Tetsuo Handa wrote:

> There are many locations that do
> 
>   if (memory_was_allocated_by_vmalloc)
>     vfree(ptr);
>   else
>     kfree(ptr);
> 
> but kvfree() can handle both kmalloc()ed memory and vmalloc()ed memory
> using is_vmalloc_addr(). Unless callers have special reasons, we can
> replace this branch with kvfree(). Please check and reply if you found
> problems.
> 
> Signed-off-by: Tetsuo Handa <penguin-kernel at I-love.SAKURA.ne.jp>
> Acked-by: Michal Hocko <mhocko at suse.com>
> Cc: Russell King <linux at arm.linux.org.uk> # arm
> Cc: <linux-acpi at vger.kernel.org> # apei
> Cc: <drbd-user at lists.linbit.com> # drbd
> Cc: <linux-kernel at vger.kernel.org> # mspec
> Cc: <dri-devel at lists.freedesktop.org> # drm
> Cc: Oleg Drokin <oleg.drokin at intel.com> # lustre
> Cc: Andreas Dilger <andreas.dilger at intel.com> # lustre
> Cc: <codalist at coda.cs.cmu.edu> # coda
> Cc: <linux-mtd at lists.infradead.org> # jffs2
> Cc: Jan Kara <jack at suse.com> # udf
> Cc: <linux-fsdevel at vger.kernel.org> # xattr
> Cc: <linux-mm at kvack.org> # ipc + mm
> Cc: <netdev at vger.kernel.org> # ipv4

Acked-by: David Rientjes <rientjes at google.com>



More information about the drbd-user mailing list