Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp934709ybg; Fri, 18 Oct 2019 09:28:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqzR4p/KUweIubSeWPD5RKtOk34hJHN5cilIFB4n/mdUs/rBaNjg4baoEhO3Lk2abkDpP7ks X-Received: by 2002:aa7:d898:: with SMTP id u24mr10485655edq.74.1571416138024; Fri, 18 Oct 2019 09:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571416138; cv=none; d=google.com; s=arc-20160816; b=I4VOp1bxo5P8M9eefD7OdJiG4iNEVyMNtKCPajE/o4naX/Qg+8Mgm8PrMfEukQLbyd J6QfLKasN6OUlq5PtaF4Bl0B8ywm4nVBIlaYLHY7JleKlqwpbtnGPrBJQJ9MJvZLpgxj GnC9d2N60rLHdGJY9p4X1IX2czjwEz7znyg3vny9r+AW+12QTm+RBTUT0ykqCWy7qkqC hKMuzmAjRpguZ084O4/tBB61rZYdp8H9biuRy6OBTEYrgjzhIricnA+aZhc8IYnhgx+f xXSTTZ5ZXLHrw80o9R3R5dsMFRu/o/9/JlvVq72Y47moc+/d6VaZCeShIQFH8ih5pYQu DXsA== 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; bh=VVCnveFMKRAtFpXlKdBbaFJvK/TEZNeWdfzYBvWWwt4=; b=Tdo/jPyHMUKShWnvQaZ4BpqpU/Qx0EBwN8IIth/+kOst/mrZEB16X4hfVehb7llIjd ovwvJsKI79Z3e85KKVrwZvpIjVOefWxZGW6aNaXyk3d1FQQAD7QL4gFSOFzP57Nr3Eko Y3VY+RYvmA768fD7PAojVfi9e3UlZufHx8FC+d6UiwBTKeb/UNXNiA9uK+mJQ6jxXQzi NSPLEy8D6gfcwgmK6g5cSo/RYkvL2kK6skhFkbD9sbLbn9cLGGlXEapKMDmR/2iXyxmu a1Ud8SNJaxa5yj/EX5asBumrrfiaAOizJe1ghGmZ3hojoeQVQpq6N/BezkHyqjYMYpcX 3TLw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n9si3894586ejs.94.2019.10.18.09.28.33; Fri, 18 Oct 2019 09:28:58 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440177AbfJQOVo (ORCPT + 99 others); Thu, 17 Oct 2019 10:21:44 -0400 Received: from mx2.suse.de ([195.135.220.15]:40578 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2440125AbfJQOVg (ORCPT ); Thu, 17 Oct 2019 10:21:36 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 341D0B4FE; Thu, 17 Oct 2019 14:21:35 +0000 (UTC) From: Oscar Salvador To: n-horiguchi@ah.jp.nec.com Cc: mhocko@kernel.org, mike.kravetz@oracle.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Oscar Salvador Subject: [RFC PATCH v2 08/16] mm,hwpoison: remove flag argument from soft offline functions Date: Thu, 17 Oct 2019 16:21:15 +0200 Message-Id: <20191017142123.24245-9-osalvador@suse.de> X-Mailer: git-send-email 2.13.7 In-Reply-To: <20191017142123.24245-1-osalvador@suse.de> References: <20191017142123.24245-1-osalvador@suse.de> 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 a/drivers/base/memory.c b/drivers/base/memory.c index 55907c27075b..b3cae2eb1c4f 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c @@ -543,7 +543,7 @@ static ssize_t soft_offline_page_store(struct device *dev, /* Only online pages can be soft-offlined (esp., not ZONE_DEVICE). */ if (!pfn_to_online_page(pfn)) return -EIO; - ret = soft_offline_page(pfn_to_page(pfn), 0); + ret = soft_offline_page(pfn_to_page(pfn)); return ret == 0 ? count : ret; } diff --git a/include/linux/mm.h b/include/linux/mm.h index 4c2cf2ea9953..0f80a1ce4e86 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2791,7 +2791,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(struct page *page, int flags); +extern int soft_offline_page(struct page *page); /* diff --git a/mm/madvise.c b/mm/madvise.c index b765860a5d04..8a0b1f901d72 100644 --- a/mm/madvise.c +++ b/mm/madvise.c @@ -893,7 +893,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(page, 0); + ret = soft_offline_page(page); } else { pr_info("Injecting memory failure for pfn %#lx at process virtual address %#lx\n", pfn, start); diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c6b31cf409d3..836d671fb74f 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1469,7 +1469,7 @@ static void memory_failure_work_func(struct work_struct *work) if (!gotten) break; if (entry.flags & MF_SOFT_OFFLINE) - soft_offline_page(pfn_to_page(entry.pfn), entry.flags); + soft_offline_page(pfn_to_page(entry.pfn)); else memory_failure(entry.pfn, entry.flags); } @@ -1602,7 +1602,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; @@ -1629,9 +1629,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)) { @@ -1644,7 +1644,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); @@ -1656,7 +1656,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); @@ -1715,7 +1715,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); @@ -1795,7 +1795,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; @@ -1825,9 +1825,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; } @@ -1848,7 +1848,6 @@ static int soft_offline_free_page(struct page *page) /** * soft_offline_page - Soft offline a page. * @page: page to offline - * @flags: flags. Same as memory_failure(). * * Returns 0 on success, otherwise negated errno. * @@ -1867,7 +1866,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(struct page *page, int flags) +int soft_offline_page(struct page *page) { int ret; unsigned long pfn = page_to_pfn(page); @@ -1884,11 +1883,11 @@ int soft_offline_page(struct page *page, 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.12.3