Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1288345pxb; Fri, 21 Jan 2022 14:26:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJzksOADvKFNVy+bFGi43CN73SbSYso1qbvyPVdR4k2vTZTgHKzRxIQDR+zdeXuqtnEh4+g+ X-Received: by 2002:a17:90a:5417:: with SMTP id z23mr2728891pjh.158.1642804014810; Fri, 21 Jan 2022 14:26:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642804014; cv=none; d=google.com; s=arc-20160816; b=C0aYLZYe1Y0KvQXHEZR+L69UGHn9BaKExI19WY6nt1D/G3RCDrWUXZGcLJupjDYeVN Zy1qyTBwRLDugsp1ECxAFPFiHVdZsLHYnrvMX1ADXfuuFLA6b6dVsYZz3vqiR/e818Xg 5gbi55tGImgG1rm+l/iyjMBLFLsXQo+/M6BjGFU9+6WxxK7l9ysSrh7bPy9LTfKDKQ/N nFS+NaJlfKmwcgwjIst//fc/93oW3A3ays2cPp9+bh0gcFRjX7J70wdP+iv8KVQSNo4J UyERFb8q/34SOMZ2Lw1Y5rcgkDfQ9y47N965KmE4fzoSRIhZJagcVHw4C9Eyq2dFhBhD zPMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ncvlTAS0L4yQCHvxcXlz75YOuPdmsFVoVMirXa2zJSc=; b=aWnCoXkitDoUFC/KT1vuiDbECeL8jtHmN0j5OjvSsRoK7lQVYmhqhHZdg4Mb+JeJsn vy8HDyPbmVhRNrEy80L+FHuqdlskUwH8MLckAOKDXEEKCnVnMLk4YzN26efgmBv0FvNI 6KI9ev4ZNQSIs7zpi/ZhXCZocqQZg9cAafYptBTu2380Rg+wmxXpwSLyKi7vtHzWNdPi MYp4cbngfZNTef9uGpvNpATlEaIlKIwAC17tdFpfbESHNCe5dbdcAsG4mFhNqAOGLIt6 jqDCtvYJfJL/ZguiWFPYBj9BXCKchyMzPnxHlctvxvCzQMGRLIZG67zBz76CoVGYeVEH ABMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T1GENQb9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w25si7071308pgk.153.2022.01.21.14.26.41; Fri, 21 Jan 2022 14:26:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=T1GENQb9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377290AbiATRW0 (ORCPT + 99 others); Thu, 20 Jan 2022 12:22:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377233AbiATRWZ (ORCPT ); Thu, 20 Jan 2022 12:22:25 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 39329C061574 for ; Thu, 20 Jan 2022 09:22:25 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id z22so31534603edd.12 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=4E6RjBb3ORBTGKI5iOC8y1c3HcdumxBz44v7yrVXogOxPzHQJbzDw32O1ky4ua+O2V uD99yLx8Z5YM1gNrIG7xUcmFKEiLrCWLynVuVF8bwlV8Y62Lu2r+v2yPn4IUc0PPC09g 6uqVF2ze+bPzydvjIWTFdc+HGP9rB52s8Qv9q6WKF27BtQ7QwHJCzQNAwCCh2SSmo+xt Hv8WCJLksSxPpJP6uonmmtzBSg9I9FMBo3+R3ni+vXeLF3ka+j5XiD5qyQL5vqn2eFGh jKyuKQ+5qEXkTj9V41SAdeZ7hc080ry6m3PkYWgJgeNWZyp0bTWUtunr6d6P0siOaMDi tzyg== X-Gm-Message-State: AOAM531ChpHcFONStKQ5rg+06R4KOtYZtQKaZoI3jQeKXAuwufU3ItH9 ueKcTeZMBCzKp73aKNXzhV8aFWdPWz6JAhy1kNQ= X-Received: by 2002:a17:906:4796:: with SMTP id cw22mr31476921ejc.594.1642699342389; Thu, 20 Jan 2022 09:22:22 -0800 (PST) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com. [209.85.128.47]) by smtp.gmail.com with ESMTPSA id d25sm1252609ejz.4.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:20 -0800 (PST) Received: by mail-wm1-f47.google.com with SMTP id j5-20020a05600c1c0500b0034d2e956aadso15302007wms.4 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" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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