From patchwork Wed Jun 24 15:01:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11623399 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7CC9360D for ; Wed, 24 Jun 2020 15:03:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3CF2E206C0 for ; Wed, 24 Jun 2020 15:03:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="G7MoKVKx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CF2E206C0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 00AF76B000D; Wed, 24 Jun 2020 11:03:46 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id EFC396B002A; Wed, 24 Jun 2020 11:03:45 -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 E12CF6B002B; Wed, 24 Jun 2020 11:03:45 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0062.hostedemail.com [216.40.44.62]) by kanga.kvack.org (Postfix) with ESMTP id C66D16B000D for ; Wed, 24 Jun 2020 11:03:45 -0400 (EDT) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7DD298245571 for ; Wed, 24 Jun 2020 15:03:45 +0000 (UTC) X-FDA: 76964424810.26.legs75_56064aa26e45 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin26.hostedemail.com (Postfix) with ESMTP id 168D318016E99 for ; Wed, 24 Jun 2020 15:02:15 +0000 (UTC) X-Spam-Summary: 1,0,0,f28bab7f7b86421b,d41d8cd98f00b204,nao.horiguchi@gmail.com,,RULES_HIT:2:41:69:355:379:541:800:960:966:968:973:988:989:1260:1345:1359:1437:1535:1605:1730:1747:1777:1792:2194:2196:2198:2199:2200:2201:2393:2559:2562:2899:2901:3138:3139:3140:3141:3142:3865:3866:3867:3868:3871:3872:3874:4049:4120:4321:4385:4470:4605:5007:6119:6261:6653:7576:7875:7903:8957:9036:9413:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12740:12895:12986:13146:13161:13229:13230:14394:21060:21080:21444:21611:21627:21666:21740:21990:22119:30003:30054,0,RBL:209.85.215.193:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.50.0.100;04yfopd8n94frf5tn9embgazxou4oycotdoxo77zoawiwsox1iku4153aiohuof.f1rf74qcbkjgn5mxs736koya11zrhnsdc16o5bjpeqgc8sbmz6gau5fz6ojycha.e-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:1:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: legs75_56064aa26e45 X-Filterd-Recvd-Size: 9367 Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by imf01.hostedemail.com (Postfix) with ESMTP for ; Wed, 24 Jun 2020 15:02:11 +0000 (UTC) Received: by mail-pg1-f193.google.com with SMTP id e9so1537679pgo.9 for ; Wed, 24 Jun 2020 08:02:11 -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=RJb1AfRKIAivwnTG//bxkyrVUV8pVUYTmNpBPgyzufTYC+PHcLZUgk8ggIQDhtbDtD Dz4YidASSfGz8RHb4wfr7WoYD7V9G8v4cX85kPV+dpN3fAxWbtmbPZgfJcewRgrC+hQN jBMr/6Wg9A9VgT/+DXc6ByoIEyzc7oCKn5JoBPqOOKP4T6lQbfHhNwn7JlUt6bu/+F2N 3cnTioXmr58aHOYQ2lpY+sarrLMjEzuLZ8fp78tgnPPrAxsertASJirA6PFyC0Wy1guE 9FpgM5gCg3BhdyIma5gMV+F3y6rlM2+5FOueP/l+HB/ACHE60Giq0hdzd7520F6IWi4A LZDQ== X-Gm-Message-State: AOAM530TuBcTGlvwthGW2wI5wkhHXbHStb/R1tDXqcHWW/8D2FkcizLk 3yDaUOmtUtoocdQ1XZ1j+puT0CAt5g== X-Google-Smtp-Source: ABdhPJxm+JnjvpU80AoxHh+Had8XftzaYnZAP7GzsXlzh51MZfQygKr75m3W9vBMzEYpKNHFs9KV4Q== 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> X-Rspamd-Queue-Id: 168D318016E99 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 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: 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);