From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752118AbbKHULd (ORCPT ); Sun, 8 Nov 2015 15:11:33 -0500 Received: from mail-yk0-f171.google.com ([209.85.160.171]:34766 "EHLO mail-yk0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751331AbbKHULb convert rfc822-to-8bit (ORCPT ); Sun, 8 Nov 2015 15:11:31 -0500 MIME-Version: 1.0 In-Reply-To: <201511081404.HGJ65681.LOSJFOtMFOVHFQ@I-love.SAKURA.ne.jp> References: <1446896665-21818-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp> <201511081404.HGJ65681.LOSJFOtMFOVHFQ@I-love.SAKURA.ne.jp> Date: Sun, 8 Nov 2015 22:11:31 +0200 Message-ID: Subject: Re: [PATCH] tree wide: Use kvfree() than conditional kfree()/vfree() From: Andy Shevchenko To: Tetsuo Handa Cc: Julia Lawall , Joe Perches , mhocko@kernel.org, linux-mm@kvack.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 8, 2015 at 7:04 AM, Tetsuo Handa wrote: > Andy Shevchenko wrote: >> Like Joe noticed you have left few places like >> void my_func_kvfree(arg) >> { >> kvfree(arg); >> } >> >> Might make sense to remove them completely, especially in case when >> you have changed the callers. > > I think we should stop at > > #define my_func_kvfree(arg) kvfree(arg) I don't think it's a good idea. > > in case someone want to add some code in future. …then leave them to decide what to do, no? Trying to hunt the problem which rather will not happen. > > Also, we might want to add a helper that does vmalloc() when > kmalloc() failed because locations that do > > ptr = kmalloc(size, GFP_NOFS); > if (!ptr) > ptr = vmalloc(size); /* Wrong because GFP_KERNEL is used implicitly */ > > are found. Another patch like Sergey suggested. > >> One more thought. Might be good to provide a coccinelle script for >> such places? Julia? > > Welcome. I'm sure I'm missing some locations. -- With Best Regards, Andy Shevchenko