Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3841888imm; Mon, 2 Jul 2018 06:34:14 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfoOZpvrurZJfgvNj8/uqIG+VBICcgxV4f+rdPAVX4qkMIc7acI9vJUn6dIFvb+pVrnJ2sC X-Received: by 2002:a62:9c17:: with SMTP id f23-v6mr15642230pfe.209.1530538454092; Mon, 02 Jul 2018 06:34:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530538454; cv=none; d=google.com; s=arc-20160816; b=la9eR6hLYXa+rwbVfA3Rl1APd+hyMxVDtroNtbjJhytksQJ6SFi1549DDymZOWNmR1 vn/YLZp4iOrVzv+b7pySzfJNCgcgcqbU3lCU/smDad8ovwLGft1lo6pUGDeiHaHpFCfW psYYYn423vMN6a0iBpXkfS6tpJcAlyAyb3bN2f5utop1n5gWN4kQm2OTdEhNnXVIh+o0 HbGMZ3Jzh2EcRW3eibHG26bcKxMo5Kn6AXK4D7QlwZrktnqZz6bP94aJVk5gD8B99SW+ Ph+URNfs4pcasHuAAkQK0HGxYsPJnE3wouDRgAFvBIZlk/Gy40r9M09YJ3k7t7COTb+u xaCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=05qXtSrqm8sILQbi8/GE3sjAaZsHIUTIEg6PsDBhXyI=; b=zdYC1myCnZsQ3RiA4NUWPlb5cXMgmLLqQDhvC5efz1bdmkTuwpkPWgHy4DaB+WZGPA KRdn5UcM4VGbL1tpZNpMorfis3TLnuZ3aePr9m4cdYpJG4+LUEeQ+0kkb6JR0PtGl6E7 i2CY5irn2Wxik+jxm6bkSGFBGaDOw7La8/bSpWUqv3IhDhScXBLVDuku6kowpZ2Qp6C1 VUJ5FyMEgU3mYHt6atvYNTCmlVdvaFIZoNXwNtR2YVc43jb3m7Y8s3tXo9eUBtuVoBcI QSm6aucWHewvU70rb07AywXBR/opcDrGNUWGI6rwylEFCagGkvjDedhX54HI/7e0SOzY oRww== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c7-v6si3788741pfg.308.2018.07.02.06.33.59; Mon, 02 Jul 2018 06:34:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752416AbeGBNcy (ORCPT + 99 others); Mon, 2 Jul 2018 09:32:54 -0400 Received: from mx2.suse.de ([195.135.220.15]:44648 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752381AbeGBNcu (ORCPT ); Mon, 2 Jul 2018 09:32:50 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id ADEC1AE07; Mon, 2 Jul 2018 13:32:49 +0000 (UTC) Date: Mon, 2 Jul 2018 15:32:47 +0200 From: Michal Hocko To: Marek Szyprowski Cc: Christoph Hellwig , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Michal Nazarewicz , Joonsoo Kim , Vlastimil Babka Subject: Re: [PATCH] mm: cma: honor __GFP_ZERO flag in cma_alloc() Message-ID: <20180702133247.GT19043@dhcp22.suse.cz> References: <20180613085851eucas1p20337d050face8ff8ea87674e16a9ccd2~3rI_9nj8b0455904559eucas1p2C@eucas1p2.samsung.com> <20180613122359.GA8695@bombadil.infradead.org> <20180613124001eucas1p2422f7916367ce19fecd40d6131990383~3uKFrT3ML1977219772eucas1p2G@eucas1p2.samsung.com> <20180613125546.GB32016@infradead.org> <20180613133913.GD20315@dhcp22.suse.cz> <20180702132335eucas1p1323fbf51cd5e82a59939d72097acee04~9kAizDyji0466904669eucas1p1w@eucas1p1.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180702132335eucas1p1323fbf51cd5e82a59939d72097acee04~9kAizDyji0466904669eucas1p1w@eucas1p1.samsung.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 02-07-18 15:23:34, Marek Szyprowski wrote: > Hi Michal, > > On 2018-06-13 15:39, Michal Hocko wrote: > > On Wed 13-06-18 05:55:46, Christoph Hellwig wrote: > >> On Wed, Jun 13, 2018 at 02:40:00PM +0200, Marek Szyprowski wrote: > >>> It is not only the matter of the spinlocks. GFP_ATOMIC is not supported > >>> by the > >>> memory compaction code, which is used in alloc_contig_range(). Right, this > >>> should be also noted in the documentation. > >> Documentation is good, asserts are better. The code should reject any > >> flag not explicitly supported, or even better have its own flags type > >> with the few actually supported flags. > > Agreed. Is the cma allocator used for anything other than GFP_KERNEL > > btw.? If not then, shouldn't we simply drop the gfp argument altogether > > rather than give users a false hope for differen gfp modes that are not > > really supported and grow broken code? > > Nope, all cma_alloc() callers are expected to use it with GFP_KERNEL gfp > mask. > The only flag which is now checked is __GFP_NOWARN. I can change the > function > signature of cma_alloc to: > struct page *cma_alloc(struct cma *cma, size_t count, unsigned int > align, bool no_warn); Are there any __GFP_NOWARN users? I have quickly hit the indirection trap and searching for alloc callback didn't tell me really much. > What about clearing the allocated buffer? Should it be another bool > parameter, done unconditionally or moved to the callers? That really depends on callers. I have no idea what they actually ask for. -- Michal Hocko SUSE Labs