From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751787AbdB0WjS (ORCPT ); Mon, 27 Feb 2017 17:39:18 -0500 Received: from mail-yw0-f193.google.com ([209.85.161.193]:36675 "EHLO mail-yw0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbdB0WjN (ORCPT ); Mon, 27 Feb 2017 17:39:13 -0500 Date: Mon, 27 Feb 2017 15:45:27 -0500 From: Tejun Heo To: Tahsin Erdogan Cc: Michal Hocko , Christoph Lameter , Andrew Morton , Chris Wilson , Andrey Ryabinin , Roman Pen , Joonas Lahtinen , zijun_hu , Joonsoo Kim , David Rientjes , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] percpu: improve allocation success rate for non-GFP_KERNEL callers Message-ID: <20170227204527.GG8707@htj.duckdns.org> References: <201702260805.zhem8KFI%fengguang.wu@intel.com> <20170226043829.14270-1-tahsin@google.com> <20170227095258.GG14029@dhcp22.suse.cz> <20170227195126.GC8707@htj.duckdns.org> <20170227202906.GF8707@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Tahsin. On Mon, Feb 27, 2017 at 12:37:59PM -0800, Tahsin Erdogan wrote: > > Ah, absolutely, that's a stupid failure but we should be able to fix > > that by making the blkg functions take gfp mask and allocate > > accordingly, right? It'll probably take preallocation tricks because > > of locking but should be doable. > > My initial goal was to allow calls to vmalloc(), but I now see the > challenges in that > approach. I'd love to see that working too but this is a different issue. Even GFP_ATOMIC can fail under pressure and it's kinda wrong to depend on that for userspace interactions. > Doing preallocations would probably work but not sure if that can be > done without > complicating code too much. Could you describe what you have in mind? So, blkg_create() already takes @new_blkg argument which is the preallocated blkg and used during q init. Wouldn't it work to make blkg_lookup_create() take @new_blkg too and pass it down to blkg_create() (and also free it if it doesn't get used)? Then, blkg_conf_prep() can always (or after a failure with -ENOMEM) allocate a new blkg before calling into blkg_lookup_create(). I don't think it'll complicate the code path that much. Thanks. -- tejun