Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp804971pxb; Thu, 23 Sep 2021 10:54:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJysn2ZP1Q0H+3z0hrLZNSK38ZNn8aNIgPvKP5Im0wajLwGI2qgAGIQV5ySAuP4B3MlxocTT X-Received: by 2002:a05:6e02:dcf:: with SMTP id l15mr4934236ilj.167.1632419678614; Thu, 23 Sep 2021 10:54:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632419678; cv=none; d=google.com; s=arc-20160816; b=hv3OPGrCxJvBE50cTmJRijyJTF5HwLChvxua4qUyZW6EnzPUdRz7kQ9qJ649ZxSFqd cQRdgySyfWvUErmWS72snwKZn2UPceu2B4fyX3wNY9rqgcewFwBa00AcV/tPpfoJZgrB OatJASDd8B2VQjvvZEHhVNI3hGbFz+CvhM1wLj8idyFb+FsYMzaRcawRFeXsmCqH9F3u lbCmiHNzPVHNre8IuoUjU6kK0C5L7K5Pfm6iQn8qEeNYSC4ty6gt1TM7JpYVS+Fqlfv8 E3ProU2osq/aAX7TeBFBkjkez3cNli3lGu36eD2iguT6jiVjzsDfW779QPoCuDtrFpjg qKPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RS0FxJMCL0LEUVuvmecsuU2aJmt73QuvVpe2GY5Tuh8=; b=xMfU8Pbn6M4RARfqU8k2nrYjMRxiLGK+ZZ26OsBO/EO6wkpFdsKWI4uOcFEhEBVeZb nksmW6/E0ydp1pFbCX/90D6y1Xob7PNWvP0uah3iKHLjlp8QIIqdmxPjq1rMi/u6xkyN b9g4FF7NhJBF9bv4DZDb9fevxi9oDoMQrfhIxbif5bcS1pHTp1tAtuOhozEr1OwmEa0c 7GeqEGBWx5EY9U3qboo0hFupYmVlSFS8eC3BLsfk1t6SSB1pUkvQ00FxbAadN7JgF33Q tqosRW5gYY3buHwvBXc0pbSHUPV7uKS5JeBzL1FV++AbzJf37VOfIOiR9Ja1Znt/ZsuW 9Kig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=DQB4lkCd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si7252483ilh.90.2021.09.23.10.54.26; Thu, 23 Sep 2021 10:54:38 -0700 (PDT) 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=@redhat.com header.s=mimecast20190719 header.b=DQB4lkCd; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241740AbhIWRzH (ORCPT + 99 others); Thu, 23 Sep 2021 13:55:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:44264 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241666AbhIWRzF (ORCPT ); Thu, 23 Sep 2021 13:55:05 -0400 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-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-17-ag9sWM3vPvaBBZ0qnte8yg-1; Thu, 23 Sep 2021 13:53:32 -0400 X-MC-Unique: ag9sWM3vPvaBBZ0qnte8yg-1 Received: by mail-qk1-f198.google.com with SMTP id w2-20020a3794020000b02903b54f40b442so21880891qkd.0 for ; Thu, 23 Sep 2021 10:53:32 -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=DYqnYRTaHYVgL7iW3+qEnzyOJrdENJu71aiUPf0A51B9wZrmBs34JoUQ2EVINhgaKx MiOLIccCfPJAxMrdWmafOc49/1NaxY2Qycqpv0vDbyHObHr3OGKIslxvSmIA24lZiMJR CI3i/VEAvN/pBqIQiu8sRnQE5+m5OFxEyy+COuA3SUZ2LT3rRzgbowTEXIi01DlUjdPc HBtYlwDQ8DPlfT4AcY87CWwSiLjyZSn2NqZ55AECACsg+TRCrfS/lOGiVJFvwS6VMRuW YR4u6nhQKYIhy9j9qUwu1VVzbuaOawhQROeWXqEfUrgLFV6HlZxnF53fYuVOdM9Tie2u szJw== X-Gm-Message-State: AOAM530jcnptCvoKNThi/92YnC+EVY3Oue8lWhXlEBr+AqCQBvU3ZtOR eI3KFFBDh4m9TkBXugM9zB8Zxqm7ZdGwbJxzMbJ4K2RRSFuzjSfq6ri+ADj8x/15PmDfQ5MFRG9 OXQKncsIiOncCmjKjz9BHFsp/ X-Received: by 2002:a05:620a:430c:: with SMTP id u12mr6262357qko.439.1632419611411; Thu, 23 Sep 2021 10:53:31 -0700 (PDT) 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 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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