From patchwork Fri Jul 31 12:21:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naoya Horiguchi X-Patchwork-Id: 11694843 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 710D0913 for ; Fri, 31 Jul 2020 12:21:49 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 313F52087C for ; Fri, 31 Jul 2020 12:21:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BV/tk3/N" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 313F52087C 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 D2EBD8D0034; Fri, 31 Jul 2020 08:21:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CDE978D0032; Fri, 31 Jul 2020 08:21:47 -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 BD7858D0034; Fri, 31 Jul 2020 08:21:47 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0242.hostedemail.com [216.40.44.242]) by kanga.kvack.org (Postfix) with ESMTP id A371A8D0032 for ; Fri, 31 Jul 2020 08:21:47 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 6A9D7181AEF0B for ; Fri, 31 Jul 2020 12:21:47 +0000 (UTC) X-FDA: 77098282254.24.neck79_330414426f83 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 473D01A4A0 for ; Fri, 31 Jul 2020 12:21:47 +0000 (UTC) X-Spam-Summary: 1,0,0,e495099aed4a2d3d,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:6742:7576:7875:7903:8957:9036:9413:11026:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12679:12740:12895:13146:13161:13229:13230:14394:21060:21080:21444:21611:21627:21666:21740:21990:22119:30003:30054,0,RBL:209.85.216.67:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100;04yrkriiddy4ntrb1yzd6q6ghgqugocotdoxo77zoawiwsox1ir1ycqax8heeym.mjkrhukrpxkawyerrc8brab3ynzrhnsdc165ir5axshi1wkn1kdzfe6trx1obnr.s-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: neck79_330414426f83 X-Filterd-Recvd-Size: 9341 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Fri, 31 Jul 2020 12:21:46 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id a9so7213424pjd.3 for ; Fri, 31 Jul 2020 05:21:46 -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=lA5hCOOxKd5KS4DNVLZggsB4V0UYIUqby39pIHtSFTI=; b=BV/tk3/NZFWzExZRn1SNk7tn+RX5lXq4zgJHfljF+UZyR8OYlwQ6WhxoZ2W4CbKbU9 aIC0N8TApCCxG61ReuM8kE5yjMT7KNnfYMx3zoSmZxZCZt/y3QDWDInmmzoSmIAmAjxY 6beapW4QD1fMhzKwMQ/2kLJ+eDDX8ZweLWlU/LlkV30myri1cY89pl7W3pKotHX68L6s GTrw4xXg/cjTVRKp9/93GQ0ai6jIJhaNZwa5sDf433kChNZ2op392ccZjb4iwj3lmEQK ubOWHqeU+keYtczKSwizHhN5/KVI7+NY7YDtvkslJ0x4PZ252mwfywCjEVDfVb7zRggu pguA== 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=lA5hCOOxKd5KS4DNVLZggsB4V0UYIUqby39pIHtSFTI=; b=bZVlS3x2RdbVjyVaJR0Sf/IAGnL6Gxri5kySiVHQdow0n+SpMq4qRIjK1kafj3CGAl qnutjlNDHxzXNJXRoxNy8s7Z6pmg+Xzdyt1auxuif1xjz2l0j82lG7LI8NKdu4YK25wZ jWFv8RTZmVf2EjpJWA+/lTLGoyGLyY7jCdIn5SuN0jMZHBjr/QCxmgVGLolp8bGCaKM0 3MYcXUXsjaEI+xobjQ96PooPZXnVvm+yFdNDuA+qpOh9xdF72yJpw9LlctXhqO7BujOE XMQn3FAFYDmDPZuyopu/W0iewORaAkrH4QUZTwxRtFQfZ7426nuc/vzstKnwTczV1bRU TGXA== X-Gm-Message-State: AOAM532G+bg7F7Y5Sz7O68+pjp2h14sX2rTi+ImE3BD3GKd5qIFEV5V9 To/UdPoRpNYu6xxXhWkN5Yar8XYm/w== X-Google-Smtp-Source: ABdhPJzctlZ9GdEehG92Jq22YQZVUDBLiYJqCJBNzg8O5fTbCmw7g1Trml4YTGAM11PZWaU48zurcA== X-Received: by 2002:a65:644d:: with SMTP id s13mr3554079pgv.103.1596198105836; Fri, 31 Jul 2020 05:21:45 -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 m19sm3675692pjv.34.2020.07.31.05.21.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2020 05:21:45 -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, cai@lca.pw, naoya.horiguchi@nec.com, linux-kernel@vger.kernel.org Subject: [PATCH v5 09/16] mm,hwpoison: remove flag argument from soft offline functions Date: Fri, 31 Jul 2020 12:21:05 +0000 Message-Id: <20200731122112.11263-10-nao.horiguchi@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200731122112.11263-1-nao.horiguchi@gmail.com> References: <20200731122112.11263-1-nao.horiguchi@gmail.com> X-Rspamd-Queue-Id: 473D01A4A0 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 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-rc7-mmotm-2020-07-27-18-18/drivers/base/memory.c v5.8-rc7-mmotm-2020-07-27-18-18_patched/drivers/base/memory.c index 4db3c660de83..3e6d27c9dff6 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/drivers/base/memory.c +++ v5.8-rc7-mmotm-2020-07-27-18-18_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-rc7-mmotm-2020-07-27-18-18/include/linux/mm.h v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/linux/mm.h index c09111e8eac8..ecb3c7191fb7 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/include/linux/mm.h +++ v5.8-rc7-mmotm-2020-07-27-18-18_patched/include/linux/mm.h @@ -2988,7 +2988,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-rc7-mmotm-2020-07-27-18-18/mm/madvise.c v5.8-rc7-mmotm-2020-07-27-18-18_patched/mm/madvise.c index 2c50c2c5673b..3eee78abdbec 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/mm/madvise.c +++ v5.8-rc7-mmotm-2020-07-27-18-18_patched/mm/madvise.c @@ -925,7 +925,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-rc7-mmotm-2020-07-27-18-18/mm/memory-failure.c v5.8-rc7-mmotm-2020-07-27-18-18_patched/mm/memory-failure.c index 9768ab5f51ef..7c0a2f8cfe0c 100644 --- v5.8-rc7-mmotm-2020-07-27-18-18/mm/memory-failure.c +++ v5.8-rc7-mmotm-2020-07-27-18-18_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); } @@ -1641,7 +1641,7 @@ EXPORT_SYMBOL(unpoison_memory); * 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; @@ -1668,9 +1668,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)) { @@ -1683,7 +1683,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); @@ -1695,7 +1695,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); @@ -1754,7 +1754,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); @@ -1838,7 +1838,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; @@ -1868,9 +1868,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; } @@ -1891,7 +1891,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. * @@ -1910,7 +1909,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; @@ -1928,11 +1927,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);