Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933344AbbKSAXl (ORCPT ); Wed, 18 Nov 2015 19:23:41 -0500 Received: from mail-pa0-f52.google.com ([209.85.220.52]:34792 "EHLO mail-pa0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755806AbbKSAXj (ORCPT ); Wed, 18 Nov 2015 19:23:39 -0500 Date: Wed, 18 Nov 2015 16:23:37 -0800 (PST) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Tetsuo Handa cc: akpm@linux-foundation.org, linux-mm@kvack.org, Russell King , linux-acpi@vger.kernel.org, drbd-user@lists.linbit.com, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Oleg Drokin , Andreas Dilger , codalist@TELEMANN.coda.cs.cmu.edu, linux-mtd@lists.infradead.org, Jan Kara , linux-fsdevel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH] tree wide: Use kvfree() than conditional kfree()/vfree() In-Reply-To: <1447070170-8512-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> Message-ID: References: <1447070170-8512-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1381 Lines: 36 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 > Acked-by: Michal Hocko > Cc: Russell King # arm > Cc: # apei > Cc: # drbd > Cc: # mspec > Cc: # drm > Cc: Oleg Drokin # lustre > Cc: Andreas Dilger # lustre > Cc: # coda > Cc: # jffs2 > Cc: Jan Kara # udf > Cc: # xattr > Cc: # ipc + mm > Cc: # ipv4 Acked-by: David Rientjes -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/