From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751684AbbEAUCh (ORCPT ); Fri, 1 May 2015 16:02:37 -0400 Received: from userp1040.oracle.com ([156.151.31.81]:41391 "EHLO userp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750807AbbEAUCd (ORCPT ); Fri, 1 May 2015 16:02:33 -0400 Date: Fri, 1 May 2015 23:02:21 +0300 From: Dan Carpenter To: "Simmons, James A." Cc: "'Julia Lawall'" , Oleg Drokin , "devel@driverdev.osuosl.org" , Greg Kroah-Hartman , "kernel-janitors@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "HPDD-discuss@lists.01.org" Subject: Re: [HPDD-discuss] [PATCH 2/11] Staging: lustre: fld: Use kzalloc and kfree Message-ID: <20150501200221.GF14154@mwanda> References: <1430495482-933-1-git-send-email-Julia.Lawall@lip6.fr> <1430495482-933-11-git-send-email-Julia.Lawall@lip6.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: aserv0021.oracle.com [141.146.126.233] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We are hopefully going to get rid of OBD_ALLOC_LARGE() as well, though. It's simple enough to write a function: void *obd_zalloc(size_t size) { if (size > 4 * PAGE_CACHE_SIZE) return vzalloc(size); else return kmalloc(size, GFP_NOFS); } Except, huh? Shouldn't we be using GFP_NOFS for the vzalloc() side? There was some discussion of that GFP_NOFS was a bit buggy back in 2010 (http://marc.info/?l=linux-mm&m=128942194520631&w=4) but the current lustre code doesn't try to pass GFP_NOFS. Then it's simple enough to change OBD_FREE_LARGE() to kvfree(). Also it's weird that only the lustre people have thought of this trick to allocate big chunks of RAM and no one else has. What would happen if we just change vmalloc() so it worked this way for everyone? regards, dan carpenter