From patchwork Sun Dec 20 04:55:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 11983777 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA533C4361B for ; Sun, 20 Dec 2020 04:55:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 4655D23A5E for ; Sun, 20 Dec 2020 04:55:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4655D23A5E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 798526B005C; Sat, 19 Dec 2020 23:55:44 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 748E46B005D; Sat, 19 Dec 2020 23:55:44 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6366A6B0068; Sat, 19 Dec 2020 23:55:44 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 45C3B6B005C for ; Sat, 19 Dec 2020 23:55:44 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E2511181AEF3F for ; Sun, 20 Dec 2020 04:55:43 +0000 (UTC) X-FDA: 77612447766.27.route37_07146282744c Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id C198C3D663 for ; Sun, 20 Dec 2020 04:55:43 +0000 (UTC) X-HE-Tag: route37_07146282744c X-Filterd-Recvd-Size: 3929 Received: from mail-pg1-f176.google.com (mail-pg1-f176.google.com [209.85.215.176]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Sun, 20 Dec 2020 04:55:43 +0000 (UTC) Received: by mail-pg1-f176.google.com with SMTP id 15so4264547pgx.7 for ; Sat, 19 Dec 2020 20:55:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=FcF2NouvPiJDMMW6Peqre7Sl9Gd+9PPy9YvcBm4wK80=; b=D5uzIne/cbKAiIjZMefTOkcN3ih04hAB5RtLU30TEI6EnXTOIAPMJt82j/YJU8ARFh Ec4aOMqwL4pms6CmW/Jz8/Dn+Gl+/le7HNB4bsALf3gIC9JwOy8QWRe/+E2fcew1E2gN 8EfOr56qFi6jMfqSHfgE1wR2SXHUBEr1x7E36ehv6p+ZMCaB75/w3W+yYNHMWSd9GJ5T vkje5+1mrR0Jk0QNn1OOiDcLZHZ9dwpjNRe9A2Gjcp94iALHtIo0DvcRCS2yY+lNZ+7T V4oJ5GohIwE19Bhz8qDFV+QDckU72y0XLqWLjbRYUiMdpRouOCpjfmoEvtEx2378tYy9 OylA== 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:mime-version :content-transfer-encoding; bh=FcF2NouvPiJDMMW6Peqre7Sl9Gd+9PPy9YvcBm4wK80=; b=LaKthU4RfZY3y87DFpJNHPKM3Fz2lw/OeaZsx6LQ2tDoe54crTO65rIieifxKPUCt4 F7GXgYtA60aUOsWjKidNi3h9+Qm4rpGXexVH4DSGWXiyVomfsjGvFOcJ4NtmCvdwd001 BjUEYe0U3sWp5Z78ppqXZ0LkmnTcL1MpJYKxS5TAtakFqxPavUVytuIiyk42msOs+pDz Xa7xixQwfRENY7/MU7yiWJoTGBk2hywE6EEY/gbqi83ywjuHV3xqsAFgT2wuLRbrftNw +0XgjdNThuNLeSC3APFqD0lW9xCDrDsxQE7GXguDl3ZEiAyP3BVBKUIMSp0o6E2BdiHF 1wXw== X-Gm-Message-State: AOAM530O+zSZeq8Kl9+zY9YKrdLEEtjAWwRe8FPhItjS9CK0JArMd+qZ TrjtnshimdXcXN7sFSVKkPWcLWSsJn4= X-Google-Smtp-Source: ABdhPJz0LZ0bmcxCEOL0g515VYxCbrTUcVk7/kjfQvTh4JDdujW3zGAw3CIP5lEvdDz6PKIpjigSHw== X-Received: by 2002:a05:6a00:816:b029:198:30d:e020 with SMTP id m22-20020a056a000816b0290198030de020mr10773792pfk.52.1608440142187; Sat, 19 Dec 2020 20:55:42 -0800 (PST) Received: from bobo.ibm.com (193-116-97-30.tpgi.com.au. [193.116.97.30]) by smtp.gmail.com with ESMTPSA id l13sm13632529pgq.51.2020.12.19.20.55.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 20:55:41 -0800 (PST) From: Nicholas Piggin To: linux-mm@kvack.org Cc: Nicholas Piggin , Linus Torvalds , Bibo Mao Subject: [PATCH v3 0/3] mm: improve pte updates and dirty/accessed Date: Sun, 20 Dec 2020 14:55:32 +1000 Message-Id: <20201220045535.848591-1-npiggin@gmail.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.002924, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Time to get this old series out again. Since last time, Bibo found a couple of the same cases I did (for MIPS only) which I extend to all archs, and I dropped the "make the pte dirty if the fork parent was dirty" due to Linus pointing out a dirty PTE costs more to unmap. It didn't seem to help a great deal anyway on the access-side fortunately. Thanks, Nick Nicholas Piggin (3): mm/cow: don't bother write protecting already write-protected huge pages mm/cow: optimise pte accessed bit handling in fork mm: optimise pte dirty/accessed bit setting by demand based pte insertion arch/mips/include/asm/pgtable.h | 2 -- include/linux/pgtable.h | 16 ---------------- mm/huge_memory.c | 16 ++++++++++------ mm/hugetlb.c | 2 +- mm/memory.c | 15 +++++++-------- mm/migrate.c | 1 + mm/shmem.c | 1 + mm/userfaultfd.c | 2 +- mm/vmscan.c | 5 +++++ 9 files changed, 26 insertions(+), 34 deletions(-)