From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 06607C30657 for ; Mon, 3 Jul 2023 17:33:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230052AbjGCRdH (ORCPT ); Mon, 3 Jul 2023 13:33:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230364AbjGCRc7 (ORCPT ); Mon, 3 Jul 2023 13:32:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C2B3E6B for ; Mon, 3 Jul 2023 10:32:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9B90160FF1 for ; Mon, 3 Jul 2023 17:32:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F4232C433C7; Mon, 3 Jul 2023 17:32:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1688405576; bh=gKJMRyM6lqs5ERz+m8mpBtGV1Df6FXjeY6I6baSh4tA=; h=Date:To:From:Subject:From; b=ZDHxjd1yHAOZx1jKWCWsr0yug0s1Sy4MDw/p2orja731xdJl41PSlai5Y5eU7pEF0 xJyLw4Py4JH2g8esaf/lOxmTL29F6ZN0GGiEAzvzYz2q8JAaPAstkByzhbvSMAD508 izK+B3QIor+A5iVFTf/FopsDanLs3s1JVimWSq9Q= Date: Mon, 03 Jul 2023 10:32:55 -0700 To: mm-commits@vger.kernel.org, zhangpeng362@huawei.com, willy@infradead.org, sidhartha.kumar@oracle.com, akpm@linux-foundation.org From: Andrew Morton Subject: + mm-memory-convert-do_read_fault-to-use-folios.patch added to mm-unstable branch Message-Id: <20230703173255.F4232C433C7@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm/memory: convert do_read_fault() to use folios has been added to the -mm mm-unstable branch. Its filename is mm-memory-convert-do_read_fault-to-use-folios.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-memory-convert-do_read_fault-to-use-folios.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: Sidhartha Kumar Subject: mm/memory: convert do_read_fault() to use folios Date: Sun, 2 Jul 2023 22:58:50 -0700 Saves one implicit call to compound_head() Link: https://lkml.kernel.org/r/20230703055850.227169-4-sidhartha.kumar@oracle.com Signed-off-by: Sidhartha Kumar Reviewed-by: ZhangPeng Cc: Matthew Wilcox Signed-off-by: Andrew Morton --- mm/memory.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/mm/memory.c~mm-memory-convert-do_read_fault-to-use-folios +++ a/mm/memory.c @@ -4539,6 +4539,7 @@ static inline bool should_fault_around(s static vm_fault_t do_read_fault(struct vm_fault *vmf) { vm_fault_t ret = 0; + struct folio *folio = page_folio(vmf->page); /* * Let's call ->map_pages() first and use ->fault() as fallback @@ -4556,9 +4557,9 @@ static vm_fault_t do_read_fault(struct v return ret; ret |= finish_fault(vmf); - unlock_page(vmf->page); + folio_unlock(folio); if (unlikely(ret & (VM_FAULT_ERROR | VM_FAULT_NOPAGE | VM_FAULT_RETRY))) - put_page(vmf->page); + folio_put(folio); return ret; } _ Patches currently in -mm which might be from sidhartha.kumar@oracle.com are mm-increase-usage-of-folio_next_index-helper.patch mm-memory-convert-do_page_mkwrite-to-use-folios.patch mm-memory-convert-wp_page_shared-to-use-folios.patch mm-memory-convert-do_shared_fault-to-folios.patch mm-memory-convert-do_read_fault-to-use-folios.patch