Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1061195iob; Thu, 28 Apr 2022 18:04:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJweyLwx48B1B6r4mVKzY4V0u6r60LZWmPceccRlubDkERcrAKUIwTcNe7cAD1auHN3oV4VG X-Received: by 2002:a2e:88ce:0:b0:24f:fff:603c with SMTP id a14-20020a2e88ce000000b0024f0fff603cmr15798176ljk.527.1651194248406; Thu, 28 Apr 2022 18:04:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651194248; cv=none; d=google.com; s=arc-20160816; b=cQEF9VMiGZ/urs9zNAJ6KXJYOvFJruKPHuT0induyaueEQvDMomVTUYaTU786aJHhE 9c9AvZZFgA8+bIOKYt4Nso/HQHMCz2B2BHiVQvbgbK5kOwakQtuJ62hAgXfNQWplV4dH y+Z9rZA0TOspohidxUh+SNJBIGwYEYUL12vrnh/fqOBXcH4umFImpTMehNBHT9iJ5VRv Z5z6BVTvRaPlf+EOH/8PU8Pdp5jd7bGLvWxPl6OdqTT+Wr0ouxW9ljdQ7IS954R1h9r6 7q02YSK9vTukQGf/K6di0+f+jPzwcaECQCW18jElnLJRL+xSJJoY0+CCm5P7sBZTFaE2 hXxA== 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=HA2iOZcTH9xcoVq+fhYi3f+JG1jZPj5iAWQGBU6dxYk=; b=InqgNE3okB5n9v7/BZIV49ro0e4Xyjx+KSbj0BDjche+TxkP3qrU0G8VMySOc6a1yD xPz/P+j4CJveQRpfV7+YmdL8Vvz5GJuCVrycJ2XFsLPRS2pZE9wAES0/4X/+DpDzvuJK dWfinTAVWneDvq6SJqW7Un/cKEdRfgeL3fEbaZ+E/FWrg4VKghIBUcqT6VMJ8gSucNcX WWn/p+f4DFR60NbH1Bvvvwhsip1AwuDQ6PN/rS3rpBLMNhowHUqW601kxRSx+EmBitDI YsYy8IXsjnDfRhFDMmyjbqINp10iUsNLFn2BXggbu+U0PoCtga6BMZsyZwNGP0Urzjec UJpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M100Rgh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c19-20020a196553000000b00449fff2820esi5555690lfj.400.2022.04.28.18.03.40; Thu, 28 Apr 2022 18:04:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=M100Rgh1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234764AbiD0XUM (ORCPT + 99 others); Wed, 27 Apr 2022 19:20:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbiD0XUI (ORCPT ); Wed, 27 Apr 2022 19:20:08 -0400 Received: from mail-pl1-x631.google.com (mail-pl1-x631.google.com [IPv6:2607:f8b0:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23E163E4; Wed, 27 Apr 2022 16:16:55 -0700 (PDT) Received: by mail-pl1-x631.google.com with SMTP id p6so2830986plf.9; Wed, 27 Apr 2022 16:16:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HA2iOZcTH9xcoVq+fhYi3f+JG1jZPj5iAWQGBU6dxYk=; b=M100Rgh1scYfFJVKHX6QedUDxXFHqefXLnvT4SqpUd/oHlGHbb/oobYGJFfZlvRt1M 95u5K/iCnx6NQ7kgK7bkszLk8x7ofF3bQKGcGV45CNFuq4OUGo/RYoEh4F3EVIvemdEx yOFupPUtEIQR2vhi+lhYq1DTpri8x/xGnjCBCf1N36k55KMSggE7TSA7G5uRqI1wT1zO J7cNpB211LLtBzO2XzHUH5cdVhbLWGjq+bDG09a3GHhMkBuqZls7iw92MiCcPd+FGFvc Z2TGRypKxvKunQrWePC0n4oj+29gCKwlaf54Vbgu4O74ohCNVv39Omp0RAR38diwNweB 9igQ== 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=HA2iOZcTH9xcoVq+fhYi3f+JG1jZPj5iAWQGBU6dxYk=; b=rbIXLOARMvvyx9QuOQQNG+djHea9U/qNUJOaUYNchtoTiZoD+/rNB9iS1FzSdGfrwX ls5SRwczhJdDEJvZo6FiRylDapsMEJvR7eW/P1ICCudj9agJl6Q6aQnUG+1qR3xgtEsU fbsPUWSO21DbtKFN1wnP3K1KHNsgEcMt9acumI+vjk+0BYS28JEfQNz1LmH5+elDEk9n N1rGkuPsMOu5gKFh63oDTmv5KfVilgq3fqOhlzpYMFi6rggu1Gk+g0WfvZSwBt2t4XBw nXhvU5EYIqYZM9sWTJUc2g11dHtX4ZAehdsbefisLhRTMquC62abOnhGmxladaoHemC5 dHcg== X-Gm-Message-State: AOAM533+bzrlagW68D7HvYXcz4hC43Be8UqUgFGgfXqJ4LDmW99J4i3r HrD82kdi05ZnzcRW8GzW6RqDfpiLw90SW7qK53Q= X-Received: by 2002:a17:90b:4b07:b0:1db:c488:7394 with SMTP id lx7-20020a17090b4b0700b001dbc4887394mr2634716pjb.21.1651101415382; Wed, 27 Apr 2022 16:16:55 -0700 (PDT) MIME-Version: 1.0 References: <20220404200250.321455-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Wed, 27 Apr 2022 16:16:41 -0700 Message-ID: Subject: Re: [v3 PATCH 0/8] Make khugepaged collapse readonly FS THP more consistent To: Matthew Wilcox Cc: Vlastimil Babka , "Kirill A. Shutemov" , Miaohe Lin , Song Liu , Rik van Riel , Zi Yan , "Theodore Ts'o" , Andrew Morton , Linux MM , Linux FS-devel Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27, 2022 at 1:59 PM Matthew Wilcox wrote: > > On Mon, Apr 04, 2022 at 05:48:49PM -0700, Yang Shi wrote: > > When khugepaged collapses file THPs, its behavior is not consistent. > > It is kind of "random luck" for khugepaged to see the file vmas (see > > report: https://lore.kernel.org/linux-mm/00f195d4-d039-3cf2-d3a1-a2c88de397a0@suse.cz/) > > since currently the vmas are registered to khugepaged when: > > - Anon huge pmd page fault > > - VMA merge > > - MADV_HUGEPAGE > > - Shmem mmap > > > > If the above conditions are not met, even though khugepaged is enabled > > it won't see any file vma at all. MADV_HUGEPAGE could be specified > > explicitly to tell khugepaged to collapse this area, but when > > khugepaged mode is "always" it should scan suitable vmas as long as > > VM_NOHUGEPAGE is not set. > > I don't see that as being true at all. The point of this hack was that > applications which really knew what they were doing could enable it. > It makes no sense to me that setting "always" by the sysadmin for shmem > also force-enables ROTHP, even for applications which aren't aware of it. > > Most telling, I think, is that Song Liu hasn't weighed in on this at > all. It's clearly not important to the original author. Song Liu already acked the series, please see https://lore.kernel.org/linux-mm/96F2D93B-2043-44C3-8062-C639372A0212@fb.com/