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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0F395C433F5 for ; Thu, 20 Jan 2022 17:22:26 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 802436B007B; Thu, 20 Jan 2022 12:22:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78A956B007E; Thu, 20 Jan 2022 12:22:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 604C66B0080; Thu, 20 Jan 2022 12:22:26 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0123.hostedemail.com [216.40.44.123]) by kanga.kvack.org (Postfix) with ESMTP id 50CF06B007B for ; Thu, 20 Jan 2022 12:22:26 -0500 (EST) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 10E7F92755 for ; Thu, 20 Jan 2022 17:22:26 +0000 (UTC) X-FDA: 79051334292.18.E66AB7C Received: from mail-ed1-f44.google.com (mail-ed1-f44.google.com [209.85.208.44]) by imf07.hostedemail.com (Postfix) with ESMTP id 591F340006 for ; Thu, 20 Jan 2022 17:22:25 +0000 (UTC) Received: by mail-ed1-f44.google.com with SMTP id f21so31619556eds.11 for ; Thu, 20 Jan 2022 09:22:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ncvlTAS0L4yQCHvxcXlz75YOuPdmsFVoVMirXa2zJSc=; b=T1GENQb9E1UWqRHycMNTqlUbmq3o2r29qENRdmVki77UXsvLGqjYxS/6zQawXlMadi HjsVwbkLX6gCgiYKZngNC32r2Io5yH9L4N1HbshyAFc7PNzBDS5J7pmlN0W3UiBxvGtv Py1S5HNdjmSWUrNKfZdIGApUVY+OjZUybBl44= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=ncvlTAS0L4yQCHvxcXlz75YOuPdmsFVoVMirXa2zJSc=; b=tUBWpql4sYnn1FGfq+ZhooQuxHCAHLaTGZeakC7qx5p6AImHa4fu9p9djamvg2dRqC HjRxihbK/LJ4pMpywoXcpmmMYvD6Md0JEUvhqo3tu7FWCn95NUTf8GqcrQsF+PPsS/sJ d70TZ9EkuFUohNEBDiWeKY/AMWws337zbEqjnB8i1sDG7l6R+pEhjT8gInexYAfywpBi geZmTmuddSMAWpXs1Jul4rbZTaGGAL6bkP7EAbyo9GKtd75xl6xAmJ/3cRizT1nYyNbQ 1sW3a02mdG2EdiygYoPr8U20iC4kXm4WbgOhx5EF7uW5VmkVl1YZxTBGYU1JogQuh6wb Jo9A== X-Gm-Message-State: AOAM53257rHo6hgMwLH4fKKqspUuiI4IJLiyejr0wNwjKq/SQBzBlxwZ gif6dhgyTScotBvN8FKVbKOdl1ABVnLZxmgLt6s= X-Google-Smtp-Source: ABdhPJyVWao2AVoPiQOJY0DfmBSWWh6aFMUlctbv6Pa4MCGTSpu970QcnMpQwoTk9DmmyVdrWRNj6A== X-Received: by 2002:a17:906:14d8:: with SMTP id y24mr10422705ejc.62.1642699343644; Thu, 20 Jan 2022 09:22:23 -0800 (PST) Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com. [209.85.128.51]) by smtp.gmail.com with ESMTPSA id v14sm1251617ejy.77.2022.01.20.09.22.20 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 20 Jan 2022 09:22:21 -0800 (PST) Received: by mail-wm1-f51.google.com with SMTP id v123so13635778wme.2 for ; Thu, 20 Jan 2022 09:22:20 -0800 (PST) X-Received: by 2002:a05:6000:1846:: with SMTP id c6mr31585wri.193.1642699339801; Thu, 20 Jan 2022 09:22:19 -0800 (PST) MIME-Version: 1.0 References: <20220113140318.11117-1-zhangliang5@huawei.com> <172ccfbb-7e24-db21-7d84-8c8d8c3805fd@redhat.com> <9cd7eee2-91fd-ddb8-e47d-e8585e5baa05@redhat.com> <747ff31c-6c9e-df6c-f14d-c43aa1c77b4a@redhat.com> <43e41259-b228-2a75-e59d-0c6a1e81912f@redhat.com> In-Reply-To: <43e41259-b228-2a75-e59d-0c6a1e81912f@redhat.com> From: Linus Torvalds Date: Thu, 20 Jan 2022 19:22:03 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] mm: reuse the unshared swapcache page in do_wp_page To: David Hildenbrand Cc: Matthew Wilcox , "zhangliang (AG)" , Andrew Morton , Linux-MM , Linux Kernel Mailing List , wangzhigang17@huawei.com Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 591F340006 X-Stat-Signature: ujbj4myr7qh81pamdahugp1chwy3yrwq Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=T1GENQb9; spf=pass (imf07.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.44 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-HE-Tag: 1642699345-860075 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Jan 20, 2022 at 5:46 PM David Hildenbrand wrote: > > I'm, not concerned about fork(), I'm concerned about other false positives. Without a fork(), you won't have the THP marked for COW, so is it really an issue? > Here is what I currently have, I hope that makes sense: >From a quick look, that patch looks fine to me, but there might be something I'm missing... And who knows what odd usage patterns there might be in this area. The whole odd Android thing with forking that zygote process. Because that zygote thing _does_ use THP, I think, and it's where the wrong-way COW thing mattered. Obviously doing COW is the right thing to do, and that case doesn't want any sharing of pages (all copies), but it might be worth at least checking that it works and there isn't some odd performance gotcha. Linus