From patchwork Fri Sep 15 10:17:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 140401 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp1007958vqi; Fri, 15 Sep 2023 05:32:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTjpJgfarCRx5liOn6BF7tveoCC1bi09qYTnu7W7Li9wlWzK5pY7T4dF4swEUGh9+agLeF X-Received: by 2002:a17:90a:985:b0:268:5575:93d9 with SMTP id 5-20020a17090a098500b00268557593d9mr1253638pjo.10.1694781143968; Fri, 15 Sep 2023 05:32:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694781143; cv=none; d=google.com; s=arc-20160816; b=Oycp8nUbMkwK0MstOfF1OkbDolZQ5bv+OYy0QxFN2GFk0dfjZzIlCvCHzooSCcPMmE 6v4yOIVkvAtEr/zXghwAFqtsHxrgzLu9G9zc6uHCy/c+LCt16mCUbCq9h3yCqmrYbPvv dWduZkt3XfT6vVBlLJJIWOirE2sCW3whZOGbS8DL4P4i3/wUZr+QiVK1elzDSB5eyEUr C9Un+fjpB5LG3+Plel1yOtPVRbYa1OiLC7/xVd59NWixpXpb8+NC/9dLsg/KRHTd/veG yr7P7JLVD2N4rQQeV2fUaPWYFeXhMHPB9cB5l/1UD682ojp8qyLIrVM9uXRYU3BKbB9n ZN1w== 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.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id ng7-20020a17090b1a8700b0026376acd6fesi3606423pjb.22.2023.09.15.05.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Sep 2023 05:32:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; 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.33 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 lipwig.vger.email (Postfix) with ESMTP id 27FC482922F1; Fri, 15 Sep 2023 03:18:10 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234185AbjIOKRz (ORCPT + 32 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 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email 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 (lipwig.vger.email [0.0.0.0]); Fri, 15 Sep 2023 03:18:10 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777106832770929813 X-GMAIL-MSGID: 1777106832770929813 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);