Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3262655imu; Sun, 13 Jan 2019 23:03:04 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ExbAUNuRIegJdQ8I7nNJG7OKKI/O9ZmZOT5khQ747KDKKXTqAtHTAwgntWvamx2wnp9j/ X-Received: by 2002:a63:6d48:: with SMTP id i69mr20927965pgc.215.1547449384759; Sun, 13 Jan 2019 23:03:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547449384; cv=none; d=google.com; s=arc-20160816; b=sWqeZzEamQpfd8PSyCcICAKYGoZ+mJ7ZVIKR70Brj9aV6Z05YyTZqyxDTiACuNTU21 /mj9w7V27lE3kSNYHxsuWvdbOjyDjy3TLwswb9j5tPcKV2A8EDuNW2qP55FracMGbzX9 rz6Mw9QZq4DS3TQmj/AYFfsknzPa1/+wnCv2PhB8NWEuOtWaIiXpJEZkhNe0bTelMhMb HHEbx1ad4G2/7Vols6YFm819d8TY4aXS3I0yFy0vzTCg3kflvpbLPpv7RqTOGruS33H6 Yd+QGFqPJ+vEegPPsSiis1mrihwPpEv/CsOcLnM8YLYIYz49Ps1wL8yTMJnSOgVbj48V 0sHQ== 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; bh=k775ONAKVJ8EzSzCsJg1Cs0KCuS2n8TTILaVSOgDu+E=; b=I5ln2qD7FnFk9PzFaCttZlTqZL9dgW/IsHaF2QADFxb2BfTbT0+Mhutt5KQ8m30SmV MPizMsgzjpfr+H1zRqeHYUjjxDrEtDkXbp9C3iszinx9fK6GSwe4D2KEvUCH2z+DXGAo CT2aW63VmXQjsS6gYb3aJ118VxaMPowS+Z2hKQabTk62/sac4rGk5CYtQ5EhQMJnDEXa jEjsjRgyzQyMjcY5zYSyOXkl8su6y+60gcwz1uL8s+6EFvj6EkHtTulCsloPKBPVJbPf GVP3DMHOgqBH99155pKrr9IAO8YfDJTP5BfJ/kuLJEbIKzmbpVC/n+NaaYF0KuimrG2u Tmng== 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 a17si26548672pgv.456.2019.01.13.23.02.48; Sun, 13 Jan 2019 23:03:04 -0800 (PST) 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 S1726545AbfANHBn (ORCPT + 99 others); Mon, 14 Jan 2019 02:01:43 -0500 Received: from mx2.suse.de ([195.135.220.15]:36658 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726460AbfANHBn (ORCPT ); Mon, 14 Jan 2019 02:01:43 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 4F069AE72; Mon, 14 Jan 2019 07:01:41 +0000 (UTC) Date: Mon, 14 Jan 2019 08:01:37 +0100 From: Michal Hocko To: Anshuman Khandual Cc: linux-mm@kvack.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-sh@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux@armlinux.org.uk, catalin.marinas@arm.com, will.deacon@arm.com, mpe@ellerman.id.au, tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, peterz@infradead.org, christoffer.dall@arm.com, marc.zyngier@arm.com, kirill@shutemov.name, rppt@linux.vnet.ibm.com, ard.biesheuvel@linaro.org, mark.rutland@arm.com, steve.capper@arm.com, james.morse@arm.com, robin.murphy@arm.com, aneesh.kumar@linux.ibm.com, vbabka@suse.cz, shakeelb@google.com, rientjes@google.com Subject: Re: [PATCH] mm: Introduce GFP_PGTABLE Message-ID: <20190114070137.GB21345@dhcp22.suse.cz> References: <1547288798-10243-1-git-send-email-anshuman.khandual@arm.com> <20190113173555.GC1578@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.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 14-01-19 09:30:55, Anshuman Khandual wrote: > > > On 01/13/2019 11:05 PM, Michal Hocko wrote: > > On Sat 12-01-19 15:56:38, Anshuman Khandual wrote: > >> All architectures have been defining their own PGALLOC_GFP as (GFP_KERNEL | > >> __GFP_ZERO) and using it for allocating page table pages. This causes some > >> code duplication which can be easily avoided. GFP_KERNEL allocated and > >> cleared out pages (__GFP_ZERO) are required for page tables on any given > >> architecture. This creates a new generic GFP flag flag which can be used > >> for any page table page allocation. Does not cause any functional change. > > > > I agree that some unification is due but GFP_PGTABLE is not something to > > expose in generic gfp.h IMHO. It just risks an abuse. I would be looking > > Why would you think that it risks an abuse ? It does not create new semantics > of allocation in the buddy. Its just uses existing GFP_KERNEL allocation which > is then getting zeroed out. The risks (if any) is exactly same as GFP_KERNEL. Beucase my experience just tells me that people tend to use whatever they find and name fits what they think they need. > > at providing asm-generic implementation and reuse it to remove the code > > Does that mean GFP_PGTABLE can be created but not in gfp.h but in some other > memory related header file ? I would just keep it close to its users. If that is a single arch generic place then only better. But I suspect some arches have special requirements. > > duplication. But I haven't tried that to know that it will work out due > > to small/subtle differences between arches. > > IIUC from the allocation perspective GFP_ACCOUNT is the only thing which gets > added with GFP_PGTABLE for user page table for memcg accounting purpose. There > does not seem to be any other differences unless I am missing something. It's been some time since I've checked the last time. Some arches were using GPF_REPEAT (__GFP_RETRY_MAYFAIL) back then. I have removed most of those but some were doing a higher order allocations so they probably have stayed. -- Michal Hocko SUSE Labs