Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp505744imm; Thu, 26 Jul 2018 07:22:44 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeaKhPW7i1KXsfIujTJnFSYSd87rp+D9YELt4QZC9cCrvPIOjrrz2fVuOUG8BhiLN9PQ6rl X-Received: by 2002:a65:66d7:: with SMTP id c23-v6mr2145749pgw.427.1532614964451; Thu, 26 Jul 2018 07:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532614964; cv=none; d=google.com; s=arc-20160816; b=H12eyAQ87EVb9cy1HAkMvHZNdgn02UijaGTSR7wiDs8dlxc+w4D8hLseL73Zk1fgZU VMWyTgu08R6fCekyFE1cidYAGUE+AXUC9r9F7nPRByh1OMD+tM288qS5fyALOnUUI51q pcMMdnurGZLaOU7cSACCLta61EGiEjOVMzZev6xrFm6Dmmoe04hZQ+aYYiPexrDKWhhh T0EbCoTXVsw+2Bh8GkmGpb20sAJaCBBYNbnjixtbiygrZ2DZ+PZz7sRRE1yWVkTNKPbG uektgECo3fEJ3aTA/m/D36VjJvy9i4ZTuKENzg9fMhsqm2nvafJXZq1mcT/iWXCNacQG OMpQ== 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=8rWtZiQMwAT7Iv6VgiEnDSvXw7adBd0z9qpwsrgFNmg=; b=Cs+UYC7zdCE+dZtWAreMBokyTAq3svyVoi5LlBK5nlp5+urxWErb3BovTpluA/OqOd SpX23u+JmQwEuu/PT5df1x5uAZ0sVuJyu8BwtivHNThOjvTpR23/rhyYV8FkZC3ZOGju NCM8mdgOa8c1s37jFgd77ep+nkNuoZeUufzQk9bTv3rXk7H5G/uaNQbiNce2r7GqEfPA TBdX+EYr/rRCWWaKYfcuVNUXsULIkpB3AyVyaZy9+atMiw20bAlatKcOwq4qJ779TNp1 oj9uAQeZler3E7hW4+LogB7VFULph4xdlzh+oXsadMdYEOcAg5QMu/uQbzKpYHFu7fOW 9pGA== 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 194-v6si1220438pgf.651.2018.07.26.07.22.29; Thu, 26 Jul 2018 07:22:44 -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 S1730292AbeGZPhq (ORCPT + 99 others); Thu, 26 Jul 2018 11:37:46 -0400 Received: from mx2.suse.de ([195.135.220.15]:60368 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729894AbeGZPhq (ORCPT ); Thu, 26 Jul 2018 11:37:46 -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 EE507AFC6; Thu, 26 Jul 2018 14:20:39 +0000 (UTC) Date: Thu, 26 Jul 2018 16:20:39 +0200 From: Michal Hocko To: Matthew Wilcox Cc: Mike Rapoport , Jonathan Corbet , Andrew Morton , linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 7/7] docs/core-api: mm-api: add section about GFP flags Message-ID: <20180726142039.GA23627@dhcp22.suse.cz> References: <1532607722-17079-1-git-send-email-rppt@linux.vnet.ibm.com> <1532607722-17079-8-git-send-email-rppt@linux.vnet.ibm.com> <20180726130106.GC3504@bombadil.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180726130106.GC3504@bombadil.infradead.org> 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 Thu 26-07-18 06:01:06, Matthew Wilcox wrote: > On Thu, Jul 26, 2018 at 03:22:02PM +0300, Mike Rapoport wrote: > > +Memory Allocation Controls > > +========================== > > Perhaps call this section "Memory Allocation Flags" instead? > > > +Linux provides a variety of APIs for memory allocation from direct > > +calls to page allocator through slab caches and vmalloc to allocators > > +of compressed memory. Although these allocators have different > > +semantics and are used in different circumstances, they all share the > > +GFP (get free page) flags that control behavior of each allocation > > +request. > > While this isn't /wrong/, I think it might not be the most useful way > of explaining what the GFP flags are to someone who's just come across > them in some remote part of the kernel. How about this paragraph instead? > > Functions which need to allocate memory often use GFP flags to express > how that memory should be allocated. The GFP acronym stands for "get > free pages", the underlying memory allocation function. OK. > Not every GFP > flag is allowed to every function which may allocate memory. Most > users will want to use a plain ``GFP_KERNEL`` or ``GFP_ATOMIC``. Or rather than mentioning the two just use "Useful GFP flag combinations" comment segment from gfp.h -- Michal Hocko SUSE Labs