Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4727179rdb; Fri, 15 Sep 2023 10:21:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFK7G4kLNo3n6e9QPjtn0L44ngOyvsRzmzQOV/O7EQhGZGc3+N8D/MSEoiXe+xtl+5Ajxuz X-Received: by 2002:a05:6a20:3c86:b0:13d:df16:cf29 with SMTP id b6-20020a056a203c8600b0013ddf16cf29mr3126365pzj.15.1694798475713; Fri, 15 Sep 2023 10:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694798475; cv=none; d=google.com; s=arc-20160816; b=r/nLnb/Wa8rz/SHdl3P1e7dWMI/p8blg3U2Mtk7eqT/rYtfNtcqhB5bxtJznjMAqTo doqAJdP5DyEuVXVjSHiG794mA6UL8L03VJmESXEqywi52Ses1gUNWuqxYOS6sOsNe00m CV6bLo8SjuiBS3nio3hUaENv7YXEXaqDQeBmwJxu4t+2BEWlR53tDEKQJAicqr/sOIkI vLVXd+YxZ0Wkpz1p6EbPcRExFhiHA8KRSab8ABO8LZQ+zj9YFP6jwh/HB+NjMVItH4I/ /CHgSlohKzPyc3eFujcxvihQcIMQS/tpkNVOez0TNERfdTWHJYnoAVoDS6A4oNnzwu12 1EhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=W4OXJL+60MT/EpFD3EhGCH+RY9u8YTytGadp3nozILg=; fh=KPJjYJHLC+uLVMTRQa7GdG2CYCH/otyIF0MYaE50dhE=; b=zv91fUIMYCTnE7ZJJpbABEuWb09bAab/hLJODElRt6YPQW4Q1xQ2hSJl/SiHVwvxZa XQi4eYYbwogVN0oT4QkNSpYtZmvfPqlZ2cDaem85x59OXucaZPxR6XnsxZDrZrfYPGTm mkeYF1TBlp93/z2SF71Kolx+hVGJqGbFFEUWBho86d0HVhERdynocSWjmN7K2yoKgRXJ 0Hl1zrMOBMdULxKHVjlrqa1z4bF/bGPLWkcn25hLnZPXzvDho03sQH1PM4AcGmqODDsk /99BZCEzwy/dVVgwAkWiPrVlOfMikYvjH1ffGOPcQxZZwf92P+oymu8nn977StjAoYwM P7Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d+A5Samu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id bv125-20020a632e83000000b005741597ab7fsi3558950pgb.96.2023.09.15.10.20.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 10:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=d+A5Samu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id C4EFE8026DCE; Fri, 15 Sep 2023 03:18:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234183AbjIOKRz (ORCPT + 99 others); Fri, 15 Sep 2023 06:17:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231341AbjIOKRz (ORCPT ); Fri, 15 Sep 2023 06:17:55 -0400 Received: from out-212.mta1.migadu.com (out-212.mta1.migadu.com [95.215.58.212]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA677E9 for ; Fri, 15 Sep 2023 03:17:49 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1694773067; 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; bh=W4OXJL+60MT/EpFD3EhGCH+RY9u8YTytGadp3nozILg=; b=d+A5SamuPrYPNNn5I5tuWu15eKBGHtzGvFPIOVyX5iIJHBTtNqpTcrJ4kHMGFctF3C1GHl /nJLrNcJGp9LFBxZV2o50jGkbr8XPT0xca3odbgRo54CViZ/Apqqnu/I8er1HP8kEwZ4VG QphZ2hyKu976OWwgN6KYRxN1dI4RYJw= From: Yajun Deng To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] mm/rmap: convert __page_check_anon_rmap() to folio Date: Fri, 15 Sep 2023 18:17:31 +0800 Message-Id: <20230915101731.1725986-1-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:18:02 -0700 (PDT) The parameter page in __page_check_anon_rmap() is redundant. Remove it, and convert __page_check_anon_rmap() to __folio_check_anon_rmap(). Signed-off-by: Yajun Deng --- mm/rmap.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 789a2beb8b3a..520607f4d91c 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1154,13 +1154,12 @@ static void __folio_set_anon(struct folio *folio, struct vm_area_struct *vma, } /** - * __page_check_anon_rmap - sanity check anonymous rmap addition + * __folio_check_anon_rmap - sanity check anonymous rmap addition * @folio: The folio containing @page. - * @page: the page to check the mapping of * @vma: the vm area in which the mapping is added * @address: the user virtual address mapped */ -static void __page_check_anon_rmap(struct folio *folio, struct page *page, +static void __folio_check_anon_rmap(struct folio *folio, struct vm_area_struct *vma, unsigned long address) { /* @@ -1176,8 +1175,8 @@ static void __page_check_anon_rmap(struct folio *folio, struct page *page, */ VM_BUG_ON_FOLIO(folio_anon_vma(folio)->root != vma->anon_vma->root, folio); - VM_BUG_ON_PAGE(page_to_pgoff(page) != linear_page_index(vma, address), - page); + VM_BUG_ON_FOLIO(folio_pgoff(folio) != linear_page_index(vma, address), + folio); } /** @@ -1245,7 +1244,7 @@ void page_add_anon_rmap(struct page *page, struct vm_area_struct *vma, __folio_set_anon(folio, vma, address, !!(flags & RMAP_EXCLUSIVE)); } else if (likely(!folio_test_ksm(folio))) { - __page_check_anon_rmap(folio, page, vma, address); + __folio_check_anon_rmap(folio, vma, address); } if (flags & RMAP_EXCLUSIVE) SetPageAnonExclusive(page); -- 2.25.1