Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1801229rwd; Fri, 9 Jun 2023 02:16:58 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4YHPiS9uLADnzZ65wvTru/INKw4uQgWp1t+qGS7ApWvUhBGgpefF2jbaxOAk5g1fbtBwqT X-Received: by 2002:a05:6a21:7887:b0:10c:7676:73af with SMTP id bf7-20020a056a21788700b0010c767673afmr404429pzc.53.1686302218210; Fri, 09 Jun 2023 02:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686302218; cv=none; d=google.com; s=arc-20160816; b=VjoIdl0isIlri96KaNwv7XoL+6i7ZA6tI49IrRQ1cLQl0vatNqSiA/vyfBjORXw2fi Ny4P0cf0yykXvDfAcnyyWVaBXkuBlS+lQ5vjC5uaU4B1QUV0MQHLosFakwEetb7yAXe7 KFoYpIXVCx3T5bw/Q6JDl2Hg3Ep+jAkO6zfNWC8c1CNq93c/qc7P+5TaANQCR423QMo0 1ofxBQE63gCY79aXHSfS5f2fru7e9WKz7gDHeieYbuso4xTA7rlwVeuE2XjMCkYANL5J SWUFZ8QtrZPTfaxQtBXO1f+gRzR+O1thJIQSoZebINbSEI2CiiZtBirAvjMh67J2HZW+ j+UQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=TLk6gSKtsM+p9Rtgq5+IZGVTEjc3fvT8GmlHeUGj3wU=; b=aM7LDbQkZEnoMSY+ZMHUSuuIXcMp+3QNp0lM9h43zsZB+15aUS8fJloRi3Xx7mEa6V eQ7DMybkiiAJDHYModmVfKBF2/h5mZa7T7DwLd1xNtQdsgSKMxiY0GYeLUSvEGBUqPfG 9CZdjvBnBy3AgLIjRhUiie3immKJyDmDYprXffTtlwcmGTidIKOEdXfjJ9EYo7Vfb7IV +atA1l9owZBOFOp5v91RNuKRUSl3hDJyYwN6HtYMELpXmw/Pb50/PqBKbDIKklZ9sC4S OZWruf+PiaKLalxnoWIoSHYUVgmBtEMVoPO4sok2J4kuwUBFVunguIBdigA6G3/QOlIQ 2iHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Bp2xxkoM; 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=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x1-20020aa79a41000000b0063b64166faesi2200258pfj.157.2023.06.09.02.16.45; Fri, 09 Jun 2023 02:16:58 -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=@redhat.com header.s=mimecast20190719 header.b=Bp2xxkoM; 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=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241123AbjFIJF4 (ORCPT + 99 others); Fri, 9 Jun 2023 05:05:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33550 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241079AbjFIJFj (ORCPT ); Fri, 9 Jun 2023 05:05:39 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 025313585 for ; Fri, 9 Jun 2023 02:04:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686301477; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=TLk6gSKtsM+p9Rtgq5+IZGVTEjc3fvT8GmlHeUGj3wU=; b=Bp2xxkoMJgqmJjf74eWqs43rtcEN0YCHR6+SbZFCacHtMQXwS+9hjxUlqgrJUt2A3dn4tB BrOlpaDRlhFRg3LLw+ENbI2BrNkavjimur+m6NAiEVGeKweKe66x6KrXHXshy1eM1sIRk1 cYVt0PKy6eJbOSz/DeLYks317X1zcy0= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-333-ODloBN01NWKctPYTZxVGcg-1; Fri, 09 Jun 2023 05:04:34 -0400 X-MC-Unique: ODloBN01NWKctPYTZxVGcg-1 Received: by mail-ej1-f72.google.com with SMTP id a640c23a62f3a-94a356c74e0so148964066b.2 for ; Fri, 09 Jun 2023 02:04:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686301473; x=1688893473; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=TLk6gSKtsM+p9Rtgq5+IZGVTEjc3fvT8GmlHeUGj3wU=; b=kl0wvhLq3esjFltxBng5KfYVKVLxAyWFcQ24kJfI3oPwD3U7nFC2oe1qLSj8+vwbNU g5knkcT9WGAUpqHCdnWa2WM/vfFDH2NYnQ5C4JmMmreF7N6MDegbqcXw19d1wbSvCyiI QS52jzyMBY2EDzlzJ0Ghn6IQGftLtTk2deUUbqCzXIrEqqecOfb8k1vcJ4lYDshMqdg6 eC8oc+ewur2URWsf+6BkU3jMh5kjTyvuLKbgpH7Pi4fNV68Yod5BYDy80k08lnwhVIid TvQL60rxjLHbPsylEeyBYz3H+IKXgCS5Wo7dve3yAcWtC3NA5EA4E8bPa96f+MAVzjY0 PV/Q== X-Gm-Message-State: AC+VfDyQ9mvL1I47bN4TJ4XNwKppaNg5+ZCOcBPfCbGwJw8WrtAmVwIm ZJ/9j0TAW4wPOHtZEznfwn+txy8HpCcyotoJT44DSlMQUwWDCojCCSCwIRyr+b2w+QsMjdmcEyR tRh7Uc3FFtFsqy9ifTjoo+4oT X-Received: by 2002:a17:907:c15:b0:94e:1764:b09b with SMTP id ga21-20020a1709070c1500b0094e1764b09bmr1027428ejc.45.1686301472952; Fri, 09 Jun 2023 02:04:32 -0700 (PDT) X-Received: by 2002:a17:907:c15:b0:94e:1764:b09b with SMTP id ga21-20020a1709070c1500b0094e1764b09bmr1027414ejc.45.1686301472616; Fri, 09 Jun 2023 02:04:32 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:9af8:e5f5:7516:fa89? ([2001:b07:6468:f312:9af8:e5f5:7516:fa89]) by smtp.googlemail.com with ESMTPSA id v5-20020a170906858500b0096f72424e00sm1013932ejx.131.2023.06.09.02.04.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 09 Jun 2023 02:04:32 -0700 (PDT) Message-ID: Date: Fri, 9 Jun 2023 11:04:29 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH mm-unstable v2 01/10] mm/kvm: add mmu_notifier_ops->test_clear_young() Content-Language: en-US To: Jason Gunthorpe , Yu Zhao Cc: Andrew Morton , Alistair Popple , Anup Patel , Ben Gardon , Borislav Petkov , Catalin Marinas , Chao Peng , Christophe Leroy , Dave Hansen , Fabiano Rosas , Gaosheng Cui , Gavin Shan , "H. Peter Anvin" , Ingo Molnar , James Morse , "Jason A. Donenfeld" , Jonathan Corbet , Marc Zyngier , Masami Hiramatsu , Michael Ellerman , Michael Larabel , Mike Rapoport , Nicholas Piggin , Oliver Upton , Paul Mackerras , Peter Xu , Sean Christopherson , Steven Rostedt , Suzuki K Poulose , Thomas Gleixner , Thomas Huth , Will Deacon , Zenghui Yu , kvmarm@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-trace-kernel@vger.kernel.org, x86@kernel.org, linux-mm@google.com References: <20230526234435.662652-1-yuzhao@google.com> <20230526234435.662652-2-yuzhao@google.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 5/31/23 21:17, Jason Gunthorpe wrote: >> + int (*test_clear_young)(struct mmu_notifier *mn, struct mm_struct *mm, >> + unsigned long start, unsigned long end, >> + bool clear, unsigned long *bitmap); >> + > Why leave clear_young behind? Just make a NULL bitmap mean > clear_young? It goes away in patch 2, together with: @@ -437,7 +412,7 @@ static inline int mmu_notifier_clear_young(struct mm_struct *mm, unsigned long end) { if (mm_has_notifiers(mm)) - return __mmu_notifier_clear_young(mm, start, end); + return __mmu_notifier_test_clear_young(mm, start, end, true, NULL); return 0; } @@ -445,7 +420,7 @@ static inline int mmu_notifier_test_young(struct mm_struct *mm, unsigned long address) { if (mm_has_notifiers(mm)) - return __mmu_notifier_test_young(mm, address); + return __mmu_notifier_test_clear_young(mm, address, address + 1, false, NULL); return 0; } Paolo