From patchwork Mon Aug 20 03:22:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Arcangeli X-Patchwork-Id: 10569853 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FF06920 for ; Mon, 20 Aug 2018 03:22:18 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B072290C8 for ; Mon, 20 Aug 2018 03:22:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F328291AC; Mon, 20 Aug 2018 03:22:18 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADE5D290C8 for ; Mon, 20 Aug 2018 03:22:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E5EA6B16E9; Sun, 19 Aug 2018 23:22:10 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 7949D6B16EC; Sun, 19 Aug 2018 23:22:10 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A9E66B16ED; Sun, 19 Aug 2018 23:22:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f200.google.com (mail-qk0-f200.google.com [209.85.220.200]) by kanga.kvack.org (Postfix) with ESMTP id 2F84D6B16E9 for ; Sun, 19 Aug 2018 23:22:10 -0400 (EDT) Received: by mail-qk0-f200.google.com with SMTP id u22-v6so13773170qkk.10 for ; Sun, 19 Aug 2018 20:22:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:in-reply-to:references; bh=YM+1RGBP5v6oaaQ5bsW9GVsTVOSu0jeIOEDLQWln6Ks=; b=UWWeThrynRhzx1ZOhu1Ate1n9DDsfFibNND4Id3z5BSWrB786DuWEqCKK9jzALyIO5 hClOpfU3hNhm3rpnYSeXBsISd4VuoNFVuNG8ZZkCRgfSyXn2CgNfDCs7/HwO31Kh8mc/ 0ZQY5B4SlkajalyDFf27X/Q4qDtGfsmh9Gy94GOwIiOknLSxvH0AEh7gj/uyE5sxZgdf ygWY/bDYhrHwJ3cQkEamQg0ZA7cKTseeZKRlB/KLF9PhA4WI+uo5aH9OZF8ajSWVqsJ4 zdu4auO/EIogNt42Hy4/C006XFAQzG66IOuaFpIzSfieTzjk/Q7rzIVL+hrBDXpHbDq8 nICA== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of aarcange@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=aarcange@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Gm-Message-State: AOUpUlGpfPTDdsipbV+asmftGWwD1SteDkXXm9EtZWzkQ0yx4fbTXGhB Ss2Qw6qq9KnJOWZc6pHNSCR0TJ6dAU8ZFYKsvB5gb03a/qcHvMnbPH1gaDWI0jySNVEOVnbdaQC C7FDWyCceyN9dKOobCBmuO1fU/7d9FvAygNyuEPf/yem6kYfDNdt5nNyYRxNhC0FlkA== X-Received: by 2002:a37:bbc1:: with SMTP id l184-v6mr38794951qkf.111.1534735330001; Sun, 19 Aug 2018 20:22:10 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy7ebDqNjnEDSdG57+cXRcUuOL5szRcuTQk0QMC02ib1Dpz2vJP35D8BP4l8euA19oP03hl X-Received: by 2002:a37:bbc1:: with SMTP id l184-v6mr38794926qkf.111.1534735329323; Sun, 19 Aug 2018 20:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534735329; cv=none; d=google.com; s=arc-20160816; b=ZLP/LbaLj76pFa1mQ+eEvTR8AfYxfepdBuDOMVohLbLmASmcSaaYA+XMRRrrSGhjTY RT+hzCBCxJUhUq0AzTzb9qUwcCxmZfyRnnvTLbk2mT22pv4Bsq7RMkzmEijSZyBbxPBx JbRI91WUVuLVcYXf5JLzwVlN2ZBBB4YVPm+JjcV280GMR2UChfxUoR7x7jRY9rlNPhED eoJlVU88OuFSqjgjFObGfs1FH/15pL8qPUhJkMlfSZTIJTmgieVKsafeW4VRLo/j2LNn Y0eKgyouJOayMoL/Npysr1bfI0v4sgdDu/pZya9SisRdxxoZt8suEqHw/cyo32u95z2Y v40Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=YM+1RGBP5v6oaaQ5bsW9GVsTVOSu0jeIOEDLQWln6Ks=; b=o0x+PvKxvWxd5YpdsZnaG9GuqEg5ovDnaOA0brnPcwV87gBK03cK7voIDkSrIdxy7J 2DjUyXnVqfhrHOGl3j8f8M2x6fEHKtg3pEZrVceeG3BoX/BeVh7mr1tYYQIDZR37EWex RkZ0/vK/q1esk7mC9MxpOHzAwkxmmoJ/9v9S1lpSTNGQmtc2xKv9+/PpiCJNxo3CDsJl dRpcVZ1H5hOwVLHDZIkC5dkxI9JSj59JZn4bN/t4CqySLu+lA8PSn1Aw2dqy7hBkwQEL mshuumBwfd8LvYCXDkwryCLUN59YP6NraehMM3MhYMKfN2Lfda3G7n6Syt2JQAH0F/P+ VdgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of aarcange@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=aarcange@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id b3-v6si3056046qva.64.2018.08.19.20.22.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 19 Aug 2018 20:22:09 -0700 (PDT) Received-SPF: pass (google.com: domain of aarcange@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of aarcange@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=aarcange@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8398713A9A; Mon, 20 Aug 2018 03:22:08 +0000 (UTC) Received: from sky.random (ovpn-120-72.rdu2.redhat.com [10.10.120.72]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2BBAE721F5; Mon, 20 Aug 2018 03:22:05 +0000 (UTC) From: Andrea Arcangeli To: Andrew Morton Cc: linux-mm@kvack.org, Alex Williamson , David Rientjes , Vlastimil Babka Subject: [PATCH 1/2] mm: thp: consolidate policy_nodemask call Date: Sun, 19 Aug 2018 23:22:03 -0400 Message-Id: <20180820032204.9591-2-aarcange@redhat.com> In-Reply-To: <20180820032204.9591-1-aarcange@redhat.com> References: <20180820032204.9591-1-aarcange@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Mon, 20 Aug 2018 03:22:08 +0000 (UTC) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP Just a minor cleanup. Signed-off-by: Andrea Arcangeli --- mm/mempolicy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 01f1a14facc4..d6512ef28cde 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -2026,6 +2026,8 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, goto out; } + nmask = policy_nodemask(gfp, pol); + if (unlikely(IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && hugepage)) { int hpage_node = node; @@ -2043,7 +2045,6 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, !(pol->flags & MPOL_F_LOCAL)) hpage_node = pol->v.preferred_node; - nmask = policy_nodemask(gfp, pol); if (!nmask || node_isset(hpage_node, *nmask)) { mpol_cond_put(pol); page = __alloc_pages_node(hpage_node, @@ -2052,7 +2053,6 @@ alloc_pages_vma(gfp_t gfp, int order, struct vm_area_struct *vma, } } - nmask = policy_nodemask(gfp, pol); preferred_nid = policy_node(gfp, pol, node); page = __alloc_pages_nodemask(gfp, order, preferred_nid, nmask); mpol_cond_put(pol);