Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp264507imm; Wed, 11 Jul 2018 01:55:53 -0700 (PDT) X-Google-Smtp-Source: AAOMgpczPhd3rf86kcQFeG5oIyPblRe7gHw4zLiQZfXSFDJrz8yZf5fX6V2ATc1Bez3wIhdBmMjW X-Received: by 2002:a65:5106:: with SMTP id f6-v6mr25432151pgq.72.1531299353678; Wed, 11 Jul 2018 01:55:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531299353; cv=none; d=google.com; s=arc-20160816; b=kJxgtjPTFGHrLTWi6bQyYtcDxqkrY5pOGLKFsjQ2wIJzMlRXJ0OeKdOgteAJCKkiU4 5+rbxnvqf5wOZPhnl1DEV6o9lNNRYGTLkbi+nXdB2BkoSPC43qJsGi3413+aK1/onWas wu3jDKPSLnv3NUygD2RPNRFeriDtjw6DwLpF+0FYGAT8rXW3r42e+5gYRz/Wsy6ORDGk 9X210bLoAjuIvvTp9MiGnWivtmXZJlS1FQMXdocVUmzUOFWAjwSMhANLPm5HJ1ppZaW3 R7TOlvRrPGSey35VC3LyImxC/JIGLDdzy9h8cL0WzE0rXPwOuaylR9iu5dSP4cuu/q1l xAQA== 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=rYvCzgOxZZELMdFRKEWSiE+VkG4aB18BQo1Vukt2aZ0=; b=DD/bowDO0pf1k8y1FIo+qIgzNFdjc6L32ULIx2U3N+UyQ+nc/1d7WVCMI6WF4Fa2Qx zY7oaHUTzrlIfA1yyg9uK2Tvpo5dGrlTxlXKFB8+IwGHBGucfx0y4VpT+wF3gZeIBGCR c6CkLNiDIQFuiirYNZKI6mfcEmiCXaU37bRi4qcA+bCLPa9r6zzfBMglRZ4QOKTfmGbZ piWFKPqRVMGNzSJQvLp/2TgCcuqWsBDZRYFz39+oMqTXq7m7Ltww7T7CrOTKE5tHdo5N VkH2myS4giiwUDEJI/Xv95ecArVZu6HO+KgBN+sxExrEq8+swGKP4DYcro5YzRPOu4Lk 7vZQ== 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 p62-v6si19680657pfb.274.2018.07.11.01.55.37; Wed, 11 Jul 2018 01:55:53 -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 S1732305AbeGKI51 (ORCPT + 99 others); Wed, 11 Jul 2018 04:57:27 -0400 Received: from mx2.suse.de ([195.135.220.15]:59348 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726384AbeGKI51 (ORCPT ); Wed, 11 Jul 2018 04:57:27 -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 B86DAACF3; Wed, 11 Jul 2018 08:54:10 +0000 (UTC) Date: Wed, 11 Jul 2018 10:54:07 +0200 From: Michal Hocko To: Joonsoo Kim Cc: Marek Szyprowski , Linux Memory Management List , LKML , linux-arm-kernel@lists.infradead.org, linuxppc-dev , iommu@lists.linux-foundation.org, Andrew Morton , Michal Nazarewicz , Joonsoo Kim , Vlastimil Babka , Christoph Hellwig , Russell King , Catalin Marinas , Will Deacon , Paul Mackerras , Benjamin Herrenschmidt , Chris Zankel , Martin Schwidefsky , Joerg Roedel , Sumit Semwal , Robin Murphy , Laura Abbott , linaro-mm-sig@lists.linaro.org Subject: Re: [PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc() Message-ID: <20180711085407.GB20050@dhcp22.suse.cz> References: <20180709121956.20200-1-m.szyprowski@samsung.com> <20180709122019eucas1p2340da484acfcc932537e6014f4fd2c29~-sqTPJKij2939229392eucas1p2j@eucas1p2.samsung.com> <20180710095056.GE14284@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Wed 11-07-18 16:35:28, Joonsoo Kim wrote: > 2018-07-10 18:50 GMT+09:00 Michal Hocko : > > On Tue 10-07-18 16:19:32, Joonsoo Kim wrote: > >> Hello, Marek. > >> > >> 2018-07-09 21:19 GMT+09:00 Marek Szyprowski : > >> > cma_alloc() function doesn't really support gfp flags other than > >> > __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. > >> > >> Although gfp_mask isn't used in cma_alloc() except no_warn, it can be used > >> in alloc_contig_range(). For example, if passed gfp mask has no __GFP_FS, > >> compaction(isolation) would work differently. Do you have considered > >> such a case? > > > > Does any of cma_alloc users actually care about GFP_NO{FS,IO}? > > I don't know. My guess is that cma_alloc() is used for DMA allocation so > block device would use it, too. If fs/block subsystem initiates the > request for the device, > it would be possible that cma_alloc() is called with such a flag. > Again, I don't know > much about those subsystem so I would be wrong. The patch converts existing users and none of them really tries to use anything other than GFP_KERNEL [|__GFP_NOWARN] so this doesn't seem to be the case. Should there be a new user requiring more restricted gfp_mask we should carefuly re-evaluate and think how to support it. Until then I would simply stick with the proposed approach because my experience tells me that a wrong gfp mask usage is way too easy so the simpler the api is the less likely we will see an abuse. -- Michal Hocko SUSE Labs