Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp652368ybt; Wed, 24 Jun 2020 08:03:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJKgCNa4+0Jz7mIfI8H9o2OAS44/kntgrdOVGmZYcCm5GyZ9lTG5zbG9+xpMcYNligGLwP X-Received: by 2002:a17:906:8488:: with SMTP id m8mr26324744ejx.236.1593011005900; Wed, 24 Jun 2020 08:03:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593011005; cv=none; d=google.com; s=arc-20160816; b=C44cTrGTbBGUicm/8eDM5CLxBd5Jo4ZkBOsgSZwM4dfDCP73OLXKS3EgjC42/2j48L A2N8HAdBveUaLU9AgJBOACDJeYuXKk1lsSmYLVALbXgMtvXuuzY58j0c+ywuFaywvCXp cKcgB1DkPPNb+AkjpMzmOD3KY/htsbTRg/Vf61lLLrHMCGUewHnkyXOQTtOKlxI2xUAS DKe8JAzDZ59R7NHyZf3aYn9cYlayzRBxJC7O53cuDcIo9U0549p8padU4nDMfImtkKif /RK/eveGe1vcLQOGT+DEeIPWIr/tx/X+vbTsEkT2PP7FbcDEBeRDP7iZ47UAEbmcGxOF kJ/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=jEC53F5SPXIDcc5jWStknbQ9117ExLc2PS78CholLvg=; b=S4m0rq7ZOf930x4dwABgkjX+0P03Vmmjzn9XzoxjBSew3DhZKPANymbAdHPbfDmHY6 sknSu67Fjd4CPfOfMm9zX3CoWZ84Fhfr822uqI+M7x4//gjiZpHsyUuv8D2KjRLWGoxr j4DPD4+74Hyjt2MMZFMzp1skKeMY0Cx2pSGJa828K5cQZdRYpkyiTVA6azaXX73e9aIX xKl4Gx/ZkhWh1H/iOf3lKoWjD4DUyQ4K/EGq/uLnnxBT+96l0MuVSfyKVjgEWT7fs1jo Fx569MKM16rfXjhtB+yaLArdi5xjFVw4o/Cyr4ccJwfBgLNyZiPZECqj0zDk5uqecFXR 3e7g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G7MoKVKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id mf5si12354387ejb.186.2020.06.24.08.03.00; Wed, 24 Jun 2020 08:03:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=G7MoKVKx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2404214AbgFXPCN (ORCPT + 99 others); Wed, 24 Jun 2020 11:02:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404207AbgFXPCK (ORCPT ); Wed, 24 Jun 2020 11:02:10 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADAA0C061573 for ; Wed, 24 Jun 2020 08:02:10 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id z5so1543809pgb.6 for ; Wed, 24 Jun 2020 08:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jEC53F5SPXIDcc5jWStknbQ9117ExLc2PS78CholLvg=; b=G7MoKVKx1VUGb9vnXguZhgBeFJkuKF9NEW8T8jp0k/P1z3BFRRySMLN0qoKTHSBe60 A2AnZ0JeffOGNpnbnDtlTVMezWm50xKTcBXrIbK4jiiLXXsqkCK9Dica8fq+dc8e9VQ3 wKsmIOoBbb73v6dLhUP+Y85Gj9AK/vXIReG/iPPBCaFu2vTHHtq4F+9YIZbkoU8HOCd3 D5k2dMQw0lVRJvH6tfznXyD7/yc2cLpB1AX2fN87E7AjzSaPJbIuod6bz5S/pvC7TKMV EDAN48Cv3KLAMFhvQG16KcjQSS5SdHErK7gvNnFFP/Vfhyrvn7ogxDyyZGyD+UE3Ic4B ePvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=jEC53F5SPXIDcc5jWStknbQ9117ExLc2PS78CholLvg=; b=ULRYFBbO6PqLInNEcLKqKNcjCxTehKUjyqRReq/UaMasgaTBEhN1w8DYkz19LS0oHJ oVn6cw1MEndNVXBVkk7j/ptls7Iq9i8YLEe/1dE5lrFOG2YKwn0ctEyRfJAsfdCW8UfA oA5u1Q6ALTOJWwyqexIHEhHBdOcy8VSNIFSgb/gNuhIeoUbKkHu/mY3sEYlGphPKsfMW 4ZhgrYkOlnTDPySl3FxiVtvJly7SPwW63tgZcAqlfWuvib7NvboP2vwi99wT77y1CgJA Lmm+43LwkGigaiSdb9vSf+MeqHWObbGT+E7PbNClpBV0hVi+9AAsP4lAZrYsBPtDCJpc tFNA== X-Gm-Message-State: AOAM532y56DJXRK1JZGboRG2EPYDYrM9QuzBcq5u7VY+23Hqqdr3d+h3 72tjE/X73LEDUYakiZBtSg== X-Received: by 2002:a62:834c:: with SMTP id h73mr31147208pfe.221.1593010930240; Wed, 24 Jun 2020 08:02:10 -0700 (PDT) Received: from ip-172-31-41-194.ap-northeast-1.compute.internal (ec2-52-199-21-241.ap-northeast-1.compute.amazonaws.com. [52.199.21.241]) by smtp.gmail.com with ESMTPSA id i125sm17013705pgd.21.2020.06.24.08.02.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:02:09 -0700 (PDT) From: nao.horiguchi@gmail.com To: linux-mm@kvack.org Cc: mhocko@kernel.org, akpm@linux-foundation.org, mike.kravetz@oracle.com, osalvador@suse.de, tony.luck@intel.com, david@redhat.com, aneesh.kumar@linux.vnet.ibm.com, zeil@yandex-team.ru, naoya.horiguchi@nec.com, linux-kernel@vger.kernel.org Subject: [PATCH v3 09/15] mm,hwpoison: remove flag argument from soft offline functions Date: Wed, 24 Jun 2020 15:01:31 +0000 Message-Id: <20200624150137.7052-10-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200624150137.7052-1-nao.horiguchi@gmail.com> References: <20200624150137.7052-1-nao.horiguchi@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Naoya Horiguchi The argument @flag no longer affects the behavior of soft_offline_page() and its variants, so let's remove them. Signed-off-by: Naoya Horiguchi Signed-off-by: Oscar Salvador --- drivers/base/memory.c | 2 +- include/linux/mm.h | 2 +- mm/madvise.c | 2 +- mm/memory-failure.c | 27 +++++++++++++-------------- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git v5.8-rc1-mmots-2020-06-20-21-44/drivers/base/memory.c v5.8-rc1-mmots-2020-06-20-21-44_patched/drivers/base/memory.c index 2b09b68b9f78..20664f279c99 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/drivers/base/memory.c +++ v5.8-rc1-mmots-2020-06-20-21-44_patched/drivers/base/memory.c @@ -463,7 +463,7 @@ static ssize_t soft_offline_page_store(struct device *dev, if (kstrtoull(buf, 0, &pfn) < 0) return -EINVAL; pfn >>= PAGE_SHIFT; - ret = soft_offline_page(pfn, 0); + ret = soft_offline_page(pfn); return ret == 0 ? count : ret; } diff --git v5.8-rc1-mmots-2020-06-20-21-44/include/linux/mm.h v5.8-rc1-mmots-2020-06-20-21-44_patched/include/linux/mm.h index 229efb3479b1..d708033c50c0 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/include/linux/mm.h +++ v5.8-rc1-mmots-2020-06-20-21-44_patched/include/linux/mm.h @@ -2998,7 +2998,7 @@ extern int sysctl_memory_failure_early_kill; extern int sysctl_memory_failure_recovery; extern void shake_page(struct page *p, int access); extern atomic_long_t num_poisoned_pages __read_mostly; -extern int soft_offline_page(unsigned long pfn, int flags); +extern int soft_offline_page(unsigned long pfn); /* diff --git v5.8-rc1-mmots-2020-06-20-21-44/mm/madvise.c v5.8-rc1-mmots-2020-06-20-21-44_patched/mm/madvise.c index bee1f4ac70d6..2b5080253406 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/mm/madvise.c +++ v5.8-rc1-mmots-2020-06-20-21-44_patched/mm/madvise.c @@ -908,7 +908,7 @@ static int madvise_inject_error(int behavior, if (behavior == MADV_SOFT_OFFLINE) { pr_info("Soft offlining pfn %#lx at process virtual address %#lx\n", pfn, start); - ret = soft_offline_page(pfn, 0); + ret = soft_offline_page(pfn); } else { pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n", pfn, start); diff --git v5.8-rc1-mmots-2020-06-20-21-44/mm/memory-failure.c v5.8-rc1-mmots-2020-06-20-21-44_patched/mm/memory-failure.c index 15b8e7fd94ed..03d3aae77f89 100644 --- v5.8-rc1-mmots-2020-06-20-21-44/mm/memory-failure.c +++ v5.8-rc1-mmots-2020-06-20-21-44_patched/mm/memory-failure.c @@ -1502,7 +1502,7 @@ static void memory_failure_work_func(struct work_struct *work) if (!gotten) break; if (entry.flags & MF_SOFT_OFFLINE) - soft_offline_page(entry.pfn, entry.flags); + soft_offline_page(entry.pfn); else memory_failure(entry.pfn, entry.flags); } @@ -1648,7 +1648,7 @@ static struct page *new_page(struct page *p, unsigned long private) * that is not free, and 1 for any other page type. * For 1 the page is returned with increased page count, otherwise not. */ -static int __get_any_page(struct page *p, unsigned long pfn, int flags) +static int __get_any_page(struct page *p, unsigned long pfn) { int ret; @@ -1675,9 +1675,9 @@ static int __get_any_page(struct page *p, unsigned long pfn, int flags) return ret; } -static int get_any_page(struct page *page, unsigned long pfn, int flags) +static int get_any_page(struct page *page, unsigned long pfn) { - int ret = __get_any_page(page, pfn, flags); + int ret = __get_any_page(page, pfn); if (ret == 1 && !PageHuge(page) && !PageLRU(page) && !__PageMovable(page)) { @@ -1690,7 +1690,7 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) /* * Did it turn free? */ - ret = __get_any_page(page, pfn, 0); + ret = __get_any_page(page, pfn); if (ret == 1 && !PageLRU(page)) { /* Drop page reference which is from __get_any_page() */ put_page(page); @@ -1702,7 +1702,7 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) return ret; } -static int soft_offline_huge_page(struct page *page, int flags) +static int soft_offline_huge_page(struct page *page) { int ret; unsigned long pfn = page_to_pfn(page); @@ -1761,7 +1761,7 @@ static int soft_offline_huge_page(struct page *page, int flags) return ret; } -static int __soft_offline_page(struct page *page, int flags) +static int __soft_offline_page(struct page *page) { int ret; unsigned long pfn = page_to_pfn(page); @@ -1841,7 +1841,7 @@ static int __soft_offline_page(struct page *page, int flags) return ret; } -static int soft_offline_in_use_page(struct page *page, int flags) +static int soft_offline_in_use_page(struct page *page) { int ret; int mt; @@ -1871,9 +1871,9 @@ static int soft_offline_in_use_page(struct page *page, int flags) mt = get_pageblock_migratetype(page); set_pageblock_migratetype(page, MIGRATE_ISOLATE); if (PageHuge(page)) - ret = soft_offline_huge_page(page, flags); + ret = soft_offline_huge_page(page); else - ret = __soft_offline_page(page, flags); + ret = __soft_offline_page(page); set_pageblock_migratetype(page, mt); return ret; } @@ -1894,7 +1894,6 @@ static int soft_offline_free_page(struct page *page) /** * soft_offline_page - Soft offline a page. * @pfn: pfn to soft-offline - * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. * @@ -1913,7 +1912,7 @@ static int soft_offline_free_page(struct page *page) * This is not a 100% solution for all memory, but tries to be * ``good enough'' for the majority of memory. */ -int soft_offline_page(unsigned long pfn, int flags) +int soft_offline_page(unsigned long pfn) { int ret; struct page *page; @@ -1931,11 +1930,11 @@ int soft_offline_page(unsigned long pfn, int flags) } get_online_mems(); - ret = get_any_page(page, pfn, flags); + ret = get_any_page(page, pfn); put_online_mems(); if (ret > 0) - ret = soft_offline_in_use_page(page, flags); + ret = soft_offline_in_use_page(page); else if (ret == 0) ret = soft_offline_free_page(page); -- 2.17.1