Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp627183pxa; Fri, 21 Aug 2020 16:51:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysS5Zl1wIDC3HPIPClXUCqSUBnd1TCVr3bQ8BuIRwn+3q75xBXEpc8dGmnElooV+ESIpSA X-Received: by 2002:a05:6402:3088:: with SMTP id de8mr5231510edb.88.1598053874720; Fri, 21 Aug 2020 16:51:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598053874; cv=none; d=google.com; s=arc-20160816; b=EIptZgDWxL7K7jMrnCZmEqhsHOOacSkdEjXa9xneMzECZlqvoW724+BtAmBtL9TTpO umfQ+WN/aFwqvuoV508yx4KrrnkzQFabNBD3swygx5mxXhQIcIVy4Se2kWwnfI7n4rv+ 2JwB8xBJloU8/eTNRpfL21sTnk0Td/uq7S9DykNdq0PEXEu+ndym6adO2l3K3SMMs5un cJ+vMHCie4TFX3FSX8y2Mo8jJm5fJ67qrxsUOeGWUn1n/45991Bqm1ql//zAQX/gBCTL QSALch3jHRbhQ/vXZ9PB7RBiJofDjuNvUSk6m/2Q7yzuYsEUXEKuzClMV3EUS97aozy2 olWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E50SJh9B+Sgxu1xn3HyIGnKmtONG1p5IzDx7ax6fnpw=; b=Tgc+DcXwIzEdwBwZe5aBexIq2pSlq27nGUgudo67i/4p+qkmSFt4qM3hASeyTSK5ya jPt+/XxZjA9vezO77i1cwzhKl1We3goEZieT2dQ4Rnse7yxKauhhRD2Krlrrg2ruSS0X YFMWEpbpitZD3kgjPm0+8YmhClEZn9Wb5YgyUr2T9fOldp3E4chxptlwamdThIkw7Hcd 9b3gYj5vASI9pCGTjuXqPudQuIjCvBOdxUzmuiWTgQ0cB8E3RXhzfxQ7kBaa1Vos3I3o 93l4VDs5bhSJiWyTTe44NUHr0RWD+sGemvoVLwRvvwu2fDoBHm4nHEChYZZSBhFSo9yV yd8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JFrEgXxE; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d10si2049242edq.275.2020.08.21.16.50.51; Fri, 21 Aug 2020 16:51:14 -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=@redhat.com header.s=mimecast20190719 header.b=JFrEgXxE; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726856AbgHUXuM (ORCPT + 99 others); Fri, 21 Aug 2020 19:50:12 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:44176 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726737AbgHUXuK (ORCPT ); Fri, 21 Aug 2020 19:50:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1598053808; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=E50SJh9B+Sgxu1xn3HyIGnKmtONG1p5IzDx7ax6fnpw=; b=JFrEgXxERp1s9dxd2I//Kn5WmQD6lezQplf/sYfeGqfiB5QUGPyEBZXqM+p7rDimLtD9bV 1WXwSTk8EP8hiGsVul0XvVNiyVgCmph7qX4ondun6+f+yegkUwhx5k9KuQntAc8dMwgOu3 DyeYUdlYlcIbPgln5nqbIZTCVRdje9k= Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-354-crDRdVQuNgm0iJMXVRqPSA-1; Fri, 21 Aug 2020 19:50:06 -0400 X-MC-Unique: crDRdVQuNgm0iJMXVRqPSA-1 Received: by mail-qk1-f197.google.com with SMTP id q18so2450784qkq.11 for ; Fri, 21 Aug 2020 16:50:06 -0700 (PDT) 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:mime-version:content-transfer-encoding; bh=E50SJh9B+Sgxu1xn3HyIGnKmtONG1p5IzDx7ax6fnpw=; b=FLKI9++G1ITXZdwUiWJysApvp7irikbXTHF8s2NFmi9tnSpWX+lBED2v+5YTcX+LVf MIUD/qS7hcgic95Ac8B2DkJqRGyzkrex/acz/xmcnmX+LnCXqctXzsrcq11yXwdBW9Ta Te/W2X7TbLsFeMmIDbzcO21HHhqNkzDeiJb6yIUg2e6LS+lpDxwGZbP6xRk9H4uZvZ6t bB2GV9MN85K2ktGUDunev+kRi+jsHQY3P1qKZzucjkFCcrkfrtfjqTBAe/XZTlnLSik1 ePDvwCcEp+7vYVWkv/KLQMGYUy1BiVpQTmMzP8JUisGt71ZW8IJbbKswujKprxrVIiTd Ujbg== X-Gm-Message-State: AOAM532FYsFmH5gWANPn2+zVJEwSEGNRC31hlNVQXJ5Fyxd4AJM2g0iZ 5mmWs4paqAJTa0kf/Oj2YWmmkSCz83whAkQ0XEQLSo8UkRQNN27YMS71cdvDQiLgk3zNYFtBi5e 015BBy6936N6pJ4P90Gd3u2hM X-Received: by 2002:a05:620a:209b:: with SMTP id e27mr4796648qka.431.1598053806054; Fri, 21 Aug 2020 16:50:06 -0700 (PDT) X-Received: by 2002:a05:620a:209b:: with SMTP id e27mr4796632qka.431.1598053805795; Fri, 21 Aug 2020 16:50:05 -0700 (PDT) Received: from localhost.localdomain (bras-vprn-toroon474qw-lp130-11-70-53-122-15.dsl.bell.ca. [70.53.122.15]) by smtp.gmail.com with ESMTPSA id t69sm2821600qka.73.2020.08.21.16.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2020 16:50:05 -0700 (PDT) From: Peter Xu To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: "Maya B . Gokhale" , Linus Torvalds , Yang Shi , Marty Mcfadden , peterx@redhat.com, Kirill Shutemov , Oleg Nesterov , Jann Horn , Jan Kara , Kirill Tkhai , Andrea Arcangeli , Christoph Hellwig , Andrew Morton Subject: [PATCH 2/4] mm/ksm: Remove reuse_ksm_page() Date: Fri, 21 Aug 2020 19:49:56 -0400 Message-Id: <20200821234958.7896-3-peterx@redhat.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821234958.7896-1-peterx@redhat.com> References: <20200821234958.7896-1-peterx@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Remove the function as the last reference has gone away with the do_wp_page() changes. Signed-off-by: Peter Xu --- include/linux/ksm.h | 7 ------- mm/ksm.c | 25 ------------------------- 2 files changed, 32 deletions(-) diff --git a/include/linux/ksm.h b/include/linux/ksm.h index e48b1e453ff5..161e8164abcf 100644 --- a/include/linux/ksm.h +++ b/include/linux/ksm.h @@ -53,8 +53,6 @@ struct page *ksm_might_need_to_copy(struct page *page, void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc); void ksm_migrate_page(struct page *newpage, struct page *oldpage); -bool reuse_ksm_page(struct page *page, - struct vm_area_struct *vma, unsigned long address); #else /* !CONFIG_KSM */ @@ -88,11 +86,6 @@ static inline void rmap_walk_ksm(struct page *page, static inline void ksm_migrate_page(struct page *newpage, struct page *oldpage) { } -static inline bool reuse_ksm_page(struct page *page, - struct vm_area_struct *vma, unsigned long address) -{ - return false; -} #endif /* CONFIG_MMU */ #endif /* !CONFIG_KSM */ diff --git a/mm/ksm.c b/mm/ksm.c index 0aa2247bddd7..74d6bfff27c4 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2657,31 +2657,6 @@ void rmap_walk_ksm(struct page *page, struct rmap_walk_control *rwc) goto again; } -bool reuse_ksm_page(struct page *page, - struct vm_area_struct *vma, - unsigned long address) -{ -#ifdef CONFIG_DEBUG_VM - if (WARN_ON(is_zero_pfn(page_to_pfn(page))) || - WARN_ON(!page_mapped(page)) || - WARN_ON(!PageLocked(page))) { - dump_page(page, "reuse_ksm_page"); - return false; - } -#endif - - if (PageSwapCache(page) || !page_stable_node(page)) - return false; - /* Prohibit parallel get_ksm_page() */ - if (!page_ref_freeze(page, 1)) - return false; - - page_move_anon_rmap(page, vma); - page->index = linear_page_index(vma, address); - page_ref_unfreeze(page, 1); - - return true; -} #ifdef CONFIG_MIGRATION void ksm_migrate_page(struct page *newpage, struct page *oldpage) { -- 2.26.2