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 X-Spam-Level: X-Spam-Status: No, score=-7.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no 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 7B477C433F5 for ; Thu, 23 Sep 2021 17:53:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 134CB6109E for ; Thu, 23 Sep 2021 17:53:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 134CB6109E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 80E826B006C; Thu, 23 Sep 2021 13:53:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7BE276B0071; Thu, 23 Sep 2021 13:53:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 637726B0072; Thu, 23 Sep 2021 13:53:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0075.hostedemail.com [216.40.44.75]) by kanga.kvack.org (Postfix) with ESMTP id 52F6C6B006C for ; Thu, 23 Sep 2021 13:53:34 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0CD458249980 for ; Thu, 23 Sep 2021 17:53:34 +0000 (UTC) X-FDA: 78619585548.28.F7EA93B Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf12.hostedemail.com (Postfix) with ESMTP id A73EB100009D for ; Thu, 23 Sep 2021 17:53:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632419613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RS0FxJMCL0LEUVuvmecsuU2aJmt73QuvVpe2GY5Tuh8=; b=DQB4lkCdNPvlZnrtiapavPb185zXSEXePbRAc7Wtbcxw/eTsL/tbX4q7XuETKx2SPJb/yL GRB6BmDaScgpq+qB02HobqF0Kwwp+FktxcF5jqjymB4YyhSURXH9f8fSMiwlrgvV9Q79Eb zmzECoBzRtS0sH7kSlI3nKOKJplZqOw= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-572-rhZV4eTfPB6ISPuarLRcgw-1; Thu, 23 Sep 2021 13:53:32 -0400 X-MC-Unique: rhZV4eTfPB6ISPuarLRcgw-1 Received: by mail-qk1-f199.google.com with SMTP id bm12-20020a05620a198c00b00432e14ddb99so20346535qkb.21 for ; Thu, 23 Sep 2021 10:53:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RS0FxJMCL0LEUVuvmecsuU2aJmt73QuvVpe2GY5Tuh8=; b=QICdgHdz6/Tm8GKhsdnbTmXOfEY3NwL7yDn+grZdVHRf4CjKX3aLeaSF9aafyfqAlU bxyQ7UrP/ZBRvJ+GD2OZ2T/wmSLX/0MbrsSJ8Ip9lSU2prEAd9t4MeVc450n8GSoQN5C slGDxc9dqol9/vqSTmaekmYP881zwLgbGQXPDiXXGlq2wOExiNzUmSO2zIsbrxA9QTdW bNN/VHiGXeqWu+v8f2/9gD/9JnRXmOhb45fkbFdz4cqHr+l3P2dio0H/oifTM0m840SF iYyJcfB3nYRt7YwT2tLbVQTpSKZAp+SN/aXzAxHq/aGm47IkQqGx7RF7Qu8rS46MvUlj gM0Q== X-Gm-Message-State: AOAM530vuXCIlzHBbnXCi1yXL+P7XmoxQL9gnYVc1qoDJuw0OmEv5QGr 8cDsQPqsE0Hi71PEShngdAwOF8KEBR0N6GPW7AIG4vmLWztRsMmEDseNwB+M9YiV5fFpiE6nIJz s7jIQjhF56ck= X-Received: by 2002:a05:620a:430c:: with SMTP id u12mr6262358qko.439.1632419611411; Thu, 23 Sep 2021 10:53:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycdT/Imqydo2OHV1Pc54wGIoPIGTdOX4/eQnsDbwI+amv/w1r6uej2BSU72J/DBcZSvW8FHw== X-Received: by 2002:a05:620a:430c:: with SMTP id u12mr6262327qko.439.1632419611106; Thu, 23 Sep 2021 10:53:31 -0700 (PDT) Received: from t490s ([2607:fea8:56a2:9100::d3ec]) by smtp.gmail.com with ESMTPSA id a8sm3605614qtx.39.2021.09.23.10.53.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Sep 2021 10:53:30 -0700 (PDT) Date: Thu, 23 Sep 2021 13:53:28 -0400 From: Peter Xu To: Axel Rasmussen Cc: Hugh Dickins , LKML , Linux MM , Andrew Morton , Andrea Arcangeli , Nadav Amit Subject: Re: [PATCH] mm/khugepaged: Detecting uffd-wp vma more efficiently Message-ID: References: <20210922175156.130228-1-peterx@redhat.com> <24224366-293a-879-95db-f69abcb0cb70@google.com> <472a3497-ba70-ac6b-5828-bc5c4c93e9ab@google.com> MIME-Version: 1.0 In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: A73EB100009D X-Stat-Signature: trs4pijc1qpp917y95mwsccgdwaddo8i Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=DQB4lkCd; spf=none (imf12.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam06 X-HE-Tag: 1632419613-502752 X-Bogosity: Ham, tests=bogofilter, spamicity=0.006012, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Sep 23, 2021 at 09:47:42AM -0700, Axel Rasmussen wrote: > My thinking there was a THP collapse bug was really just based on > speculation, not a real reproducer, so it's very possible my > speculation was wrong. It will take some more thinking and reading to > convince myself one way or the other. :) Thanks to you and Hugh for > all the details. > > I'd prefer not to add this fix "just in case", if it isn't a real > problem, as it seems like it may confuse future readers of the code. It's not "just in case" to me - IMHO it's theoretically causing more false positives as I used to mention, at least that's my understanding so far. So if the theory is correct it'll 100% happen when khugepaged merged some minor-registered regions. Uffd-wp could have many false positives like this if we don't support swap - at last we decided to fully support swap then we removed all the false positives regarding swapping. I think it's similar here, but khugepaged should trigger much less frequently on the false positives upon uffd-minor, than swapping upon uffd-wp. But yes, there's definitely no rush on thinking or anything - it'll never hurt to think more. And more importantly, verify it with some test program would be great; after all theoretically it'll just work like a charm to me. > > I'll send out a patch for it if / when I manage to build a real > reproducer. Or, in the meantime, some of my Google colleagues are > testing this code via their live migration implementation, so if there > is a bug here there's a good chance we'll find it that way too. Sounds like a good plan. Thanks, -- Peter Xu