Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp8202671ybn; Tue, 1 Oct 2019 04:55:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqwj3pICkHzZohhTDI/tg3WPoRM8viKVR7pnru+P+Vrf2RFIBlFkUR+Bi8fFkOcey22BNwQH X-Received: by 2002:a05:6402:1f4:: with SMTP id i20mr25044776edy.137.1569930950472; Tue, 01 Oct 2019 04:55:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569930950; cv=none; d=google.com; s=arc-20160816; b=fu1GW2NH2XFqcpGWxtJeyuhn+HAYFJMwp2Ew6JyP9NjFn+LJW0i9Q3hPXNtstB/UyO 3o/7sYz+srzNVqMLu6zEkNiN+mfzLKZz8jFFn+t6Cl80xj61gyi9OyaCNmNfCpPKTa9C EXojy4O/0L6LAJpgNMAKWI5JtQ6XPLYo/yygZqGTkCMM0lTMJ0HtbEYfhaeLc7v7N/US hF5lIFCVeXULg6X+9RBMpSBqgZis1vEJGJua9xtFMe987y9xv3Xz6hBlM5B+jBj4o3Ma /Seu17LsgD0kpNGKh+qP2IBZxRO5fr/vsjeDdIQvL62qYPQBjttiJFA/4rpXTKlawDPk 3CHw== 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:dkim-signature; bh=jcFbftEjpta2y13GA3RqR5AgEFWor73R7GJxlkXb1DY=; b=px2a+0zSWefz2n8PdgjfPnexcRofWs2JRan3RdyzFMg87JOeMoGTHgx5nSZXIFTPMf IpyPiOw6T7hoDdIJ8QfOESGqZNlfp9/e8QOhmLTg58Pk7HvvdJtVm0SjEUxt4h1YAax4 xPS5xa1KbzWRHktCu0MoxeYMcW7aBHXXXF+deiN4YcMu7miU9a3f/81ZSSgOAJPB85nN QCsk0Gk+LfyhE7MbmUhO510XPzdqtRItfuccFFUfOjJ6x3HycBlL7sgborDKBe4XA5+x VboWi5Y9ck5G6zE29OXRXiGaaHMrWtrHRG1CEU8OOqPh0MMIxzUO4Ijkbt2Ih4X3YlqT ecFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Efj+B4nT; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h50si8825288ede.423.2019.10.01.04.55.25; Tue, 01 Oct 2019 04:55:50 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=Efj+B4nT; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726621AbfJALwm (ORCPT + 99 others); Tue, 1 Oct 2019 07:52:42 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:42787 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725844AbfJALwl (ORCPT ); Tue, 1 Oct 2019 07:52:41 -0400 Received: by mail-ed1-f67.google.com with SMTP id y91so11584649ede.9 for ; Tue, 01 Oct 2019 04:52:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=jcFbftEjpta2y13GA3RqR5AgEFWor73R7GJxlkXb1DY=; b=Efj+B4nT92PjxgLdwaAbikzCcl7RsoyXjmBuG3TdB5B+wVU1va5i6kHvlgx3TYSiq5 P7Oehmi5qiapBr6TjX1oe+MXono1XYg96rgVu6HmWVBbiWucafeqkQRpbEEnLxBopMff pJMUxzc11m0vOZ2GOVy4XXg0GYeqeV43xGTWt+3/mqaiQSTXRqH+WdiTCc6YkFL1q/mv bo5RKnIp3WAEPuh0dSKZc5Ep/5saVyKEnJzInVAMIlBlZFFAlHmu3G7RHUO8e6AcBk2g HlXneZzHgrH4ZeIJKOaiHIM+emYZH3LxW7dgQ32wRpjgqItJjCS2N6qG4xv/e7S+S0km QGbw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=jcFbftEjpta2y13GA3RqR5AgEFWor73R7GJxlkXb1DY=; b=AYJYMXaaHCk3DzPAExV5Nh5mXtU5kIWq5HXPtyn5js/B2QS0gXHqz9k9rKAdPSKJ5M 75tbSI3evfgz6RhsNiFmdRBJEiDuMMH0mFx/wrxgXjctmyBjClFtRuu4AXNurt/HISkW Bg6rPsqzFha+QluuYN+CWjp2pzJ20ItYBpUdV0MMg1LaEqGFCN5usbrK6uXBE7kUsXzr 5paHUIBQ3C2C/yi9iNzW61s67MzyNc24KVLQrX0aifcNMKbgvJyIE3TFErDty6IAAfxW XC3Xpx5CrScaGDFz6okcUd3IaEDHP1aaxpBPW47k6Vj9Th2v1NZpR+TX4A3BEGs5bmPF iiuQ== X-Gm-Message-State: APjAAAUbbaI0n6eGikWLXyWMMurh6LnrqTdsVHYAAq1TaUFRIbWaw2zd 3RTHgn8i3ygUyXXGLuTjJlaSwA== X-Received: by 2002:aa7:d995:: with SMTP id u21mr25117039eds.271.1569930759583; Tue, 01 Oct 2019 04:52:39 -0700 (PDT) Received: from box.localdomain ([86.57.175.117]) by smtp.gmail.com with ESMTPSA id f36sm3091085ede.28.2019.10.01.04.52.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Oct 2019 04:52:38 -0700 (PDT) Received: by box.localdomain (Postfix, from userid 1000) id 925F2102FB8; Tue, 1 Oct 2019 14:52:39 +0300 (+03) Date: Tue, 1 Oct 2019 14:52:39 +0300 From: "Kirill A. Shutemov" To: Ralph Campbell Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A . Shutemov" , Andrew Morton Subject: Re: [PATCH] mm/thp: make set_huge_zero_page() return void Message-ID: <20191001115239.dqodyji3r32zjkea@box> References: <20190930195528.32553-1-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190930195528.32553-1-rcampbell@nvidia.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 12:55:28PM -0700, Ralph Campbell wrote: > The return value from set_huge_zero_page() is never checked so simplify > the code by making it return void. > > Signed-off-by: Ralph Campbell > --- > mm/huge_memory.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index c5cb6dcd6c69..6cf0ee65538d 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -686,20 +686,18 @@ static inline gfp_t alloc_hugepage_direct_gfpmask(struct vm_area_struct *vma) > } > > /* Caller must hold page table lock. */ > -static bool set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, > +static void set_huge_zero_page(pgtable_t pgtable, struct mm_struct *mm, > struct vm_area_struct *vma, unsigned long haddr, pmd_t *pmd, > struct page *zero_page) > { > pmd_t entry; > - if (!pmd_none(*pmd)) > - return false; > + Wat? So you just bindly overwrite whatever is there? NAK. > entry = mk_pmd(zero_page, vma->vm_page_prot); > entry = pmd_mkhuge(entry); > if (pgtable) > pgtable_trans_huge_deposit(mm, pmd, pgtable); > set_pmd_at(mm, haddr, pmd, entry); > mm_inc_nr_ptes(mm); > - return true; > } > > vm_fault_t do_huge_pmd_anonymous_page(struct vm_fault *vmf) > -- > 2.20.1 > > -- Kirill A. Shutemov