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 9546AC433FE for ; Wed, 22 Sep 2021 17:33:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 35CD260D42 for ; Wed, 22 Sep 2021 17:33:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 35CD260D42 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 636D694000B; Wed, 22 Sep 2021 13:33:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E557940009; Wed, 22 Sep 2021 13:33:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 484B594000B; Wed, 22 Sep 2021 13:33:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 3AAF2940009 for ; Wed, 22 Sep 2021 13:33:02 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id E10211828D951 for ; Wed, 22 Sep 2021 17:33:01 +0000 (UTC) X-FDA: 78615904962.19.51A357E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf26.hostedemail.com (Postfix) with ESMTP id 8065C20019D7 for ; Wed, 22 Sep 2021 17:33:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1632331981; 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=MZ4chEPGfSUbQ0+WB80DpWY3pUb3ySacIIiH07OzzAA=; b=M7IB6PCnAqwaU1XXmmi2xx9F9fk2w9V8021o14jQPv+UbIF8Sjloj+kgQRBCj4zFGU5LlV Nd4rthDeJ77f8jwdbGX+HUQ/K+CoSHqsfTOLb9ENu8ns9V0xN21Cz/03VsByTtjHQj2YJu AFblJ/g80Re3JxvpGHkvymTpdf9IxV0= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-411-W3AFqO0QNs6N2Suc7wpwIQ-1; Wed, 22 Sep 2021 13:32:59 -0400 X-MC-Unique: W3AFqO0QNs6N2Suc7wpwIQ-1 Received: by mail-qv1-f70.google.com with SMTP id j4-20020ad454c4000000b0037a900dda7aso13141637qvx.14 for ; Wed, 22 Sep 2021 10:32:59 -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=MZ4chEPGfSUbQ0+WB80DpWY3pUb3ySacIIiH07OzzAA=; b=0mHP26cnn2ydtrKVtlu3OyP5AQtIcQ3L7RvQSZBP0Vp6STqjvrlfJ9Jo4Gsx+f01n+ BoDoT/2LwzdTp+ACbw9vXk7eb7GcOiuFXjDazUBzyxOgEoeiCugNMPbb2AIlpSIEo+Nl hg3gLwBKXLIVatFisigSdkE/bd9Be3iIIaODh667L1jxeVQoqoX5G13mRq1dXSkad7vn qgU9S83pe+LMftkUfTLF+066+d9gF9SrQqebKTlQL+K8u9K5Fne5a1N3JBCySYR6xvsC y3FVTAzHxLl54zt4OtCMo5LDVbnCqp4WcRmfoa67PKnjq05KEm9yW8rDHR5B/Azykjnp gLTA== X-Gm-Message-State: AOAM5317XeSIHFV1/kBs7kqHkDovloDlOmemQg4tZwxBI5eMx8mOlDzb TdCzfR8g1iXJsb44cptPr+vBW08jjZ8W0ZeQ0TK8qKgxoUZTBtwTauadz/UwVb4P6Laa25jet5t uL5GPkVdQ4Pw= X-Received: by 2002:a37:a394:: with SMTP id m142mr441167qke.62.1632331979230; Wed, 22 Sep 2021 10:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxW3s8uMYgBcSDjxDYcpMGPxHXsr8QBkq7aoss9LqopmKZ+usF6kGL5uVjE8LbpBJf8Uk26UQ== X-Received: by 2002:a37:a394:: with SMTP id m142mr441144qke.62.1632331978972; Wed, 22 Sep 2021 10:32:58 -0700 (PDT) Received: from t490s ([2607:fea8:56a2:9100::d3ec]) by smtp.gmail.com with ESMTPSA id j26sm1821108qtr.53.2021.09.22.10.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Sep 2021 10:32:57 -0700 (PDT) Date: Wed, 22 Sep 2021 13:32:56 -0400 From: Peter Xu To: Axel Rasmussen Cc: Andrew Morton , Shuah Khan , Linux MM , Linuxkselftest , LKML Subject: Re: [PATCH 1/3] userfaultfd/selftests: fix feature support detection Message-ID: References: <20210921163323.944352-1-axelrasmussen@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-Stat-Signature: bc4sawzndej97jqjqebiroe4cnnn766p Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=M7IB6PCn; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf26.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=peterx@redhat.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 8065C20019D7 X-HE-Tag: 1632331981-85769 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: Hello, Axel, On Wed, Sep 22, 2021 at 10:04:03AM -0700, Axel Rasmussen wrote: > Thanks for discussing the design Peter. I have some ideas which might > make for a nicer v2; I'll massage the code a bit and see what I can > come up with. Sure thing. Note again that as I don't have a strong opinion on that, feel free to keep it. However if you provide v2, I'll read. [off-topic below] Another thing I probably have forgot but need your confirmation is, when you worked on uffd minor mode, did you explicitly disable thp, or is it allowed? When I'm reworking the uffd-wp series, I noticed that commit e1e267c7928f ("khugepaged: skip collapse if uffd-wp detected", 2020-04-07) was actually awkward and not efficient, as we can simply lookup the vma flags for detecting uffd-wp enablement. I'm preparing a patch for it to do it by checking vmas (and that patch will also pave the way for file-backed). Then I noticed we need similar thing for minor mode? I think the answer is yes, but I didn't see any code that explicitly handled thp for minor mode, do you remember? To be explicit, what if in mcontinue_atomic_pte() we get a shmem_getpage() call with a thp returned? Will minor mode break? I plan to post the khugepaged patch soon and I plan to cover minor mode too there, but I'm not sure whether that's enough, as the thp can be there from the 1st day I think, but I could have missed something. -- Peter Xu