Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp654771ybt; Wed, 24 Jun 2020 08:06:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLAFyl1sdD2LyCHH4OaZCiKGtdi32NSTb3d/cOKXovyljM5H47uPiavXfvbK0cwwxyPlPM X-Received: by 2002:a50:fb14:: with SMTP id d20mr27434862edq.209.1593011185460; Wed, 24 Jun 2020 08:06:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593011185; cv=none; d=google.com; s=arc-20160816; b=qSBDu/Ab9ORWGh1zs10YLVXgwY9FnzO++neyVV/yAI7aClHAML70STgMU5bQyA7yhF W1os3Kn+ezJx0MybFw4fTBb+DWNudyaT4t9f4T9yRcQOKWn0mpis1nUCwiazXCOfYqRW QB0F7CDB6A3qW4OFjza5XregsYP65K4XyeT8dCfkYvTYKXcrgC1vtl1HJefv7q8hIy+k IpOv6q326jZ863yFQ6wAJWsNK+dCrlsJIODfcQyhqQGtcP30hPU5bBASvedKY2Pt94R8 hlDLQdUg5Tmx8dRVfsIKyRlaUsLCvjvrlQx0kVukPyz5NYKDIowbJhmBEKTynLJYMT5L 3U5A== 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=AX72C3H9DY0Mb5nGoxeAb59dD5E4L2tnEFRCjP+Wlf0=; b=i9DMe9sGXnuffMDulyt522mSrB8L//Qyfadt0/NtZYvL/vO7N6ockMof1+jQC3Au36 h3Yv+GB/54rkOvCQUQjsS+7YovsTAqQrtcFq9CALp9ecc2PreVTvJmlgAdDR5NcbarWO jEN7CkGRXTFDaw36++Pr5Gf+h/k8aR/AP9U9B2TAvqivjv9mkz5IZRivto5QcrZjX2Bc Xn3LXCiQARuw66B1MLO9DJaISo8VCxdtF73bVgMnAEvFyr5mWfJhtNFvgP+wyPz7Stu8 cf3HtPVnYhxDxivY2SX1Ja0oKZsCrL8fCL++UL1s/kCtfuscc3QxAGepo/F7o5oYV2f/ 64qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LFg5uFeW; 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 cf29si13619751edb.419.2020.06.24.08.06.01; Wed, 24 Jun 2020 08:06: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=LFg5uFeW; 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 S2404299AbgFXPCx (ORCPT + 99 others); Wed, 24 Jun 2020 11:02:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404188AbgFXPCE (ORCPT ); Wed, 24 Jun 2020 11:02:04 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99578C061573 for ; Wed, 24 Jun 2020 08:02:04 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id h22so1270845pjf.1 for ; Wed, 24 Jun 2020 08:02:04 -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=AX72C3H9DY0Mb5nGoxeAb59dD5E4L2tnEFRCjP+Wlf0=; b=LFg5uFeW+cQFpKjqfrepLPJFXJYZI5jo+KJSD84e95ZgJsJe6vZV1nTxVBtW+wmsb/ GoCNmNqBUvAZF3rwX5w2UQlJ2qe127xTSeU5ExIGpur6PQ2bbOgyjG+3Y0w+rB+XiX4M XGro7t420rVC4lzMJiy9rHwkRgFxGm2CkPxxQzyENzrMCgMaTS8Ca3Ybs6vJORMc1gQ4 jt4AEMla4ryL4dhP3JzwSo/Yn3MIi6s+JKWSqNsXFIKyJHOCRrnTPgVR/JS5YOh1ATZY +4GFNztX8mRXICs+o2eK4Zq5FRSexNGMtVyMMJ4t9dyCJSX7klwef3SSkaxQnGcY5QdX n3qQ== 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=AX72C3H9DY0Mb5nGoxeAb59dD5E4L2tnEFRCjP+Wlf0=; b=FzxAJijc7DJ12RL0O/wtL5qqiKQl1KHOWQQ97uDKRtHNIt+CVG3ftA4KELPVvouOnN QfxVXOFyR6YB7WDclawe6H6NuuwQ8e56gMQ36Bq7KFEKc42C61XX9OtwaiEGo8RaGG1k CCjhE1S7rgT9vwswh3JDI5HTSCVaztVpe/ErbgjJwcN5L9Z2Za/vqF6CFfUovFC5R+07 pPlBNTAEFXaIPFYakp5fSlfn+PxFkHI3/2WjdHrkTTN47qRZHFJ6gc8EsvtAgeFAsOqJ y2nuM40+tQdCsLn3NjkD+KWsV9H+hYd8zaSL0YXt14SSHDMIo59Y7ipmr1fWmFd1DOeG nyiQ== X-Gm-Message-State: AOAM531cfDp4vNeAGNKxpeudGzxIdmMBu1qeP4ZPVUKGsBL2i4+hPtJ/ Uuz6UiFpEpq2wL86tJZErw== X-Received: by 2002:a17:90a:364e:: with SMTP id s72mr6620071pjb.226.1593010924030; Wed, 24 Jun 2020 08:02:04 -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.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 08:02:03 -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 07/15] mm,hwpoison: Kill put_hwpoison_page Date: Wed, 24 Jun 2020 15:01:29 +0000 Message-Id: <20200624150137.7052-8-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: Oscar Salvador After commit 4e41a30c6d50 ("mm: hwpoison: adjust for new thp refcounting"), put_hwpoison_page got reduced to a put_page. Let us just use put_page instead. Signed-off-by: Oscar Salvador Signed-off-by: Naoya Horiguchi --- include/linux/mm.h | 1 - mm/memory-failure.c | 30 +++++++++++++++--------------- 2 files changed, 15 insertions(+), 16 deletions(-) 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 050e9cffc2ea..c64ffec363b5 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 @@ -2995,7 +2995,6 @@ extern int memory_failure(unsigned long pfn, int flags); extern void memory_failure_queue(unsigned long pfn, int flags); extern void memory_failure_queue_kick(int cpu); extern int unpoison_memory(unsigned long pfn); -#define put_hwpoison_page(page) put_page(page) extern int sysctl_memory_failure_early_kill; extern int sysctl_memory_failure_recovery; extern void shake_page(struct page *p, int access); 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 48feb45047f7..0b7d9769cf29 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 @@ -1144,7 +1144,7 @@ static int memory_failure_hugetlb(unsigned long pfn, int flags) pr_err("Memory failure: %#lx: just unpoisoned\n", pfn); num_poisoned_pages_dec(); unlock_page(head); - put_hwpoison_page(head); + put_page(head); return 0; } @@ -1336,7 +1336,7 @@ int memory_failure(unsigned long pfn, int flags) pfn); if (TestClearPageHWPoison(p)) num_poisoned_pages_dec(); - put_hwpoison_page(p); + put_page(p); return -EBUSY; } unlock_page(p); @@ -1389,14 +1389,14 @@ int memory_failure(unsigned long pfn, int flags) pr_err("Memory failure: %#lx: just unpoisoned\n", pfn); num_poisoned_pages_dec(); unlock_page(p); - put_hwpoison_page(p); + put_page(p); return 0; } if (hwpoison_filter(p)) { if (TestClearPageHWPoison(p)) num_poisoned_pages_dec(); unlock_page(p); - put_hwpoison_page(p); + put_page(p); return 0; } @@ -1630,9 +1630,9 @@ int unpoison_memory(unsigned long pfn) } unlock_page(page); - put_hwpoison_page(page); + put_page(page); if (freeit && !(pfn == my_zero_pfn(0) && page_count(p) == 1)) - put_hwpoison_page(page); + put_page(page); return 0; } @@ -1690,7 +1690,7 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) /* * Try to free it. */ - put_hwpoison_page(page); + put_page(page); shake_page(page, 1); /* @@ -1699,7 +1699,7 @@ static int get_any_page(struct page *page, unsigned long pfn, int flags) ret = __get_any_page(page, pfn, 0); if (ret == 1 && !PageLRU(page)) { /* Drop page reference which is from __get_any_page() */ - put_hwpoison_page(page); + put_page(page); pr_info("soft_offline: %#lx: unknown non LRU page type %lx (%pGp)\n", pfn, page->flags, &page->flags); return -EIO; @@ -1722,7 +1722,7 @@ static int soft_offline_huge_page(struct page *page, int flags) lock_page(hpage); if (PageHWPoison(hpage)) { unlock_page(hpage); - put_hwpoison_page(hpage); + put_page(hpage); pr_info("soft offline: %#lx hugepage already poisoned\n", pfn); return -EBUSY; } @@ -1733,7 +1733,7 @@ static int soft_offline_huge_page(struct page *page, int flags) * get_any_page() and isolate_huge_page() takes a refcount each, * so need to drop one here. */ - put_hwpoison_page(hpage); + put_page(hpage); if (!ret) { pr_info("soft offline: %#lx hugepage failed to isolate\n", pfn); return -EBUSY; @@ -1782,7 +1782,7 @@ static int __soft_offline_page(struct page *page, int flags) wait_on_page_writeback(page); if (PageHWPoison(page)) { unlock_page(page); - put_hwpoison_page(page); + put_page(page); pr_info("soft offline: %#lx page already poisoned\n", pfn); return -EBUSY; } @@ -1797,7 +1797,7 @@ static int __soft_offline_page(struct page *page, int flags) * would need to fix isolation locking first. */ if (ret == 1) { - put_hwpoison_page(page); + put_page(page); pr_info("soft_offline: %#lx: invalidated\n", pfn); SetPageHWPoison(page); num_poisoned_pages_inc(); @@ -1817,7 +1817,7 @@ static int __soft_offline_page(struct page *page, int flags) * Drop page reference which is came from get_any_page() * successful isolate_lru_page() already took another one. */ - put_hwpoison_page(page); + put_page(page); if (!ret) { LIST_HEAD(pagelist); /* @@ -1861,7 +1861,7 @@ static int soft_offline_in_use_page(struct page *page, int flags) pr_info("soft offline: %#lx: non anonymous thp\n", page_to_pfn(page)); else pr_info("soft offline: %#lx: thp split failed\n", page_to_pfn(page)); - put_hwpoison_page(page); + put_page(page); return -EBUSY; } unlock_page(page); @@ -1934,7 +1934,7 @@ int soft_offline_page(unsigned long pfn, int flags) if (PageHWPoison(page)) { pr_info("soft offline: %#lx page already poisoned\n", pfn); if (flags & MF_COUNT_INCREASED) - put_hwpoison_page(page); + put_page(page); return -EBUSY; } -- 2.17.1