Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp2389935imb; Mon, 4 Mar 2019 04:04:06 -0800 (PST) X-Google-Smtp-Source: APXvYqx75Es62klcTmjo9B2IAnNxtejiOTolT0b7mLX1JjXTZaG8mlXNk8gtjXthfualMeBgdB1U X-Received: by 2002:a62:f54d:: with SMTP id n74mr19443657pfh.98.1551701045949; Mon, 04 Mar 2019 04:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551701045; cv=none; d=google.com; s=arc-20160816; b=vR45FrIHJgNnlWJLvDBw/MxFVxMTCky0wEd/bJgPxlBmhNAL70kIzQwvCNYqXoLwrE MrOzHQVcHRwAfm2KWV3cQd9IcYJa5cOvP+R50uIlutpGX3OLieV8uLUW0cWau1z8489C W9MsDkPU4zGt9u8J9GonYhh6PghSPGpuJlg0yMOn1cSITfaIu520uo+DFLHC04CyDr8i JU0Jh1BsxOh5YpKuMyyeTUcuIaKFt+ZctPMp9QEbXv1dBYUte9XiB5rxnxdX71FD29qx kKtsbKb9Ry53HBEZPo0Kdjy6wCgcNGKU3L+wHmx3xv6+83+uFuc+z2G7RFMGUWemzgnx otDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=guNt41lbGYnWxFVBh6b7n+727OGehx1dipKcWFoG7GU=; b=fGvUUOBq1CV8Hde9QnKIXlnL3o20hvvFwKi9K9xXZaVhCByW2oRZvix7Uj2oXUCppK nyGuuRrwsxRZH5SOW9/ZXBRBOGBK4004++Wxug96wrFCNwBB5JRq0FPWNCYZ20Wop9CD 12QhZpykjXXLc73zNrPXaCabZRYfKv+3I+diUFtdZQIiL4IoIrFobiLKv105BnEv5jS7 V4QDNspesDVPJNbODFfSbJ+SgoXgx06ZQlp9owL0qSq9+TyV4HW47/b5aMJGMLqE6a51 TaIHo6tUeHSk7T7u5UueVBrFEHlIxoZz8BCxawuMOKBCdbY0Cvi458JVhvWMXxKiy5Op zQqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZPLxhhUG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cm8si5682345plb.47.2019.03.04.04.03.49; Mon, 04 Mar 2019 04:04:05 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ZPLxhhUG; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726358AbfCDMCi (ORCPT + 99 others); Mon, 4 Mar 2019 07:02:38 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:43462 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725974AbfCDMCh (ORCPT ); Mon, 4 Mar 2019 07:02:37 -0500 Received: by mail-lf1-f68.google.com with SMTP id p73so2713180lfe.10 for ; Mon, 04 Mar 2019 04:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=guNt41lbGYnWxFVBh6b7n+727OGehx1dipKcWFoG7GU=; b=ZPLxhhUGFE6sMjm3CSX4MszZlekzYseSBuXShoSJEbve7Xpt+HQY7w3aeVVyLg4Q0E rz7SXNHehlssV433+XEAIW+tp2lSezTqc63anXsa40gxQxPKcIq0TAONzL0VJ9OskPbj cW9TXVBRh4OsrAbIh/rubW5G2pUGiuBhpaaI8DCsn1cPa94gFdXHKiOs2tk9j2Vs5UD/ uCaUrU4iFVtcw6CzLfZz++4nKr1QmZM8aNt4MW5ACPNOBmdSQBZx4rqcM0LExoa5rwmF AvM1oSs13MP69AGzes7Y+Hro3O0a6R+ve/0ZfnI3ZQ/LLFc0W1qDaDpeMudvr0MEYGWP H66A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=guNt41lbGYnWxFVBh6b7n+727OGehx1dipKcWFoG7GU=; b=UQBddc6GFLKsz6wP8YxqWjHC4qvmRELOJFTQoT8ty0mvKq4J+B4bl9fpwATQakWLxH 0pMvCa3aNHzoyMtAElCzIYfX5ANYMlF2Pn5tgo01lJiOs7Bt8Ha//AdmQanDoOIwbnLM ftQX0QPupGkffs15ozk4xwdWnMENZsIwCRFrptrUpBIGzhz6UN6zMzOUN7TOznbS7xb3 WCR4aIpeoDFpwJ2ArMs5oe59QtOzdEOGa9xPGplEqAN9lIRmN/0QK26c8tYO0+UfSJvi haO0eebUJtIIfFnu0jLhnnFTkzugLv/skdraMqIdVGB3qKYDsHRKiNxJblwXoGJsy4r8 aE3g== X-Gm-Message-State: APjAAAX5wSo/fbr32uVdX7QvzdFkj7v2XT1fFLnipTqooOuUvl3zRiVd dRXybbGFw5FSlgY+Pv10aSvAjHAuYZTIxKPH91g= X-Received: by 2002:a19:4bd1:: with SMTP id y200mr1046951lfa.64.1551700955508; Mon, 04 Mar 2019 04:02:35 -0800 (PST) MIME-Version: 1.0 References: <20190301221956.97493-1-cai@lca.pw> In-Reply-To: <20190301221956.97493-1-cai@lca.pw> From: Souptick Joarder Date: Mon, 4 Mar 2019 17:32:23 +0530 Message-ID: Subject: Re: [PATCH v2] mm/hugepages: fix "orig_pud" set but not used To: Qian Cai Cc: Andrew Morton , Matthew Wilcox , Linux-MM , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 2, 2019 at 3:50 AM Qian Cai wrote: > > The commit a00cc7d9dd93 ("mm, x86: add support for PUD-sized transparent > hugepages") introduced pudp_huge_get_and_clear_full() but no one uses > its return code. In order to not diverge from > pmdp_huge_get_and_clear_full(), just change zap_huge_pud() to not assign > the return value from pudp_huge_get_and_clear_full(). > > mm/huge_memory.c: In function 'zap_huge_pud': > mm/huge_memory.c:1982:8: warning: variable 'orig_pud' set but not used > [-Wunused-but-set-variable] > pud_t orig_pud; > ^~~~~~~~ > 4th argument passed to pudp_huge_get_and_clear_full() is not used. Is it fine to remove *int full * in pudp_huge_get_and_clear_full() if there is no plan to use it in future ? This is applicable to below functions as well - pmdp_huge_get_and_clear_full() ptep_get_and_clear_full() pte_clear_not_present_full() > Signed-off-by: Qian Cai > --- > > v2: keep returning a code from pudp_huge_get_and_clear_full() for possible > future uses. > > mm/huge_memory.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index faf357eaf0ce..9f57a1173e6a 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -1979,7 +1979,6 @@ spinlock_t *__pud_trans_huge_lock(pud_t *pud, struct vm_area_struct *vma) > int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, > pud_t *pud, unsigned long addr) > { > - pud_t orig_pud; > spinlock_t *ptl; > > ptl = __pud_trans_huge_lock(pud, vma); > @@ -1991,8 +1990,7 @@ int zap_huge_pud(struct mmu_gather *tlb, struct vm_area_struct *vma, > * pgtable_trans_huge_withdraw after finishing pudp related > * operations. > */ > - orig_pud = pudp_huge_get_and_clear_full(tlb->mm, addr, pud, > - tlb->fullmm); > + pudp_huge_get_and_clear_full(tlb->mm, addr, pud, tlb->fullmm); > tlb_remove_pud_tlb_entry(tlb, pud, addr); > if (vma_is_dax(vma)) { > spin_unlock(ptl); > -- > 2.17.2 (Apple Git-113) >