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 DEFEFC4332F for ; Thu, 3 Nov 2022 01:45:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230320AbiKCBpL (ORCPT ); Wed, 2 Nov 2022 21:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229770AbiKCBpJ (ORCPT ); Wed, 2 Nov 2022 21:45:09 -0400 Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A718912616 for ; Wed, 2 Nov 2022 18:45:08 -0700 (PDT) Received: by mail-qt1-x82c.google.com with SMTP id c15so452857qtw.8 for ; Wed, 02 Nov 2022 18:45:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to; bh=Wf7K6DzyqqBjFrezQMeybffBuwbwWuOxP9c2dDDBwRA=; b=INoLVtvkga2hOnf6CXSVVi7qkOYjUtycEaLZOhN97m6SDyqXTmXB4AfnKKFeD9FTar wMDzfWicgjZyRiQMU0f7JMvKfE8CDGgy75IXPLKh5/Xa1WAcJauS7opadb3GTpAVhzzk KagULt7kZz+MSzr1+/1Umnz8A1C068b3SKH4MMzEzO0iY6e6nlIgti16PAMzQOgZjv0z pQc105MhQhS2Ukc1xrJKcNKPW2KCM4/Met1So6rs4v58FOUG56toyZrs+alPsSBNXYxx 3m9dVPfRCjlbP8nXudsQxnSsI7vJYoVbXAn2ehpYrSya5ROpDrMbmwOs9Z+2kSZUdUdl OcUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=Wf7K6DzyqqBjFrezQMeybffBuwbwWuOxP9c2dDDBwRA=; b=FM1NEGVaP4o3fBzzh5RwVmBn1VxQAkcEF2qzDwqhGmLwYiOXokoaAXLubiWIzMahEx 4/IesZs/faINK7pll46ZhI7SDDfG+fU2XMRMXo48SAVZi1HKv+0lTGajxyzTITcQD/ro aFhgYrwL3lLqjcCOCHOKuvCnxWfjZv/hJlzlrJwEdci39v8ziEHC4xF81jSNPJom3vyP ByQYZJWe962W6hNU4vKwN+P4zKmh0NLQSaEbELERGhXbEar2JglhPpAdTYuLWmHRYQPK Dhv1b6MH/hS1jU/xIq+b0I3jSYnS63e6uDhP6su74c1KbZ8PqS2jmtmht16pZpu6RW25 aNxA== X-Gm-Message-State: ACrzQf1DeO63W8/VJWc9Qy+++dWj6wAFcl6rwnqtHhvjVVJMUTsULxg/ eIXUt3wzrsn5Wd5PX1zmOPGBYw== X-Google-Smtp-Source: AMsMyM5fS44QwhRBsL6UbFlEOiI89VgJCALTzt6SQxOeXhsODaGtGfa8+4FGBHJaR+CDeqH38mhr0g== X-Received: by 2002:ac8:4f57:0:b0:3a5:5191:b34b with SMTP id i23-20020ac84f57000000b003a55191b34bmr701662qtw.111.1667439907713; Wed, 02 Nov 2022 18:45:07 -0700 (PDT) Received: from ripple.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id bk20-20020a05620a1a1400b006f3e6933bacsm9777239qkb.113.2022.11.02.18.45.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Nov 2022 18:45:06 -0700 (PDT) Date: Wed, 2 Nov 2022 18:44:53 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@ripple.attlocal.net To: Andrew Morton cc: "Kirill A. Shutemov" , Matthew Wilcox , David Hildenbrand , Vlastimil Babka , Peter Xu , Yang Shi , John Hubbard , Mike Kravetz , Sidhartha Kumar , Muchun Song , Miaohe Lin , Naoya Horiguchi , Mina Almasry , James Houghton , Zach O'Keefe , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: [PATCH 0/3] mm,huge,rmap: unify and speed up compound mapcounts Message-ID: <5f52de70-975-e94f-f141-543765736181@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I had intended to send just a self-explanatory 1/2 and 2/2 against 6.1-rc3 on Monday; but checked for clashes with linux-next (mainly mm-unstable) just before sending, and fuzz in mm_types.h revealed not just a clash with Sidhartha's series, but also that I had missed the hugetlb usage of tail page->private, problematic for me on 32-bit. So that series was slightly broken; and although it would probably have been easy to fix with a "SUBPAGE_INDEX_SUBPOOL = 2" patch, that would not have moved us forward very well. So this series is against next-20221102 (and hopefully later nexts), with a preparatory 1/3 to rejig the hugetlb tail private usage, on top of Sidhartha's. 1/3 mm,hugetlb: use folio fields in second tail page 2/3 mm,thp,rmap: simplify compound page mapcount handling 3/3 mm,thp,rmap: lock_compound_mapcounts() on THP mapcounts 2/3 and 3/3 can almost be applied cleanly to 6.1-rc3 (okay when you are on 64-bit): just a couple of easily resolved rejects. Documentation/mm/transhuge.rst | 34 +--- include/linux/hugetlb.h | 23 +-- include/linux/hugetlb_cgroup.h | 31 +-- include/linux/mm.h | 85 ++++++--- include/linux/mm_types.h | 91 ++++++--- include/linux/page-flags.h | 21 -- include/linux/rmap.h | 12 +- mm/Kconfig | 2 +- mm/debug.c | 5 +- mm/folio-compat.c | 6 - mm/huge_memory.c | 37 +--- mm/hugetlb.c | 2 + mm/khugepaged.c | 11 +- mm/memory-failure.c | 5 +- mm/page_alloc.c | 27 +-- mm/rmap.c | 359 ++++++++++++++++++++--------------- mm/util.c | 79 -------- 17 files changed, 401 insertions(+), 429 deletions(-) Hugh