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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A50E3C433FE for ; Thu, 6 Oct 2022 09:35:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DA3D08E0002; Thu, 6 Oct 2022 05:35:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D53FB8E0001; Thu, 6 Oct 2022 05:35:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BCD858E0002; Thu, 6 Oct 2022 05:35:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id A8E958E0001 for ; Thu, 6 Oct 2022 05:35:43 -0400 (EDT) Received: from smtpin19.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 7C31F1A10C2 for ; Thu, 6 Oct 2022 09:35:43 +0000 (UTC) X-FDA: 79990017366.19.0142110 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf30.hostedemail.com (Postfix) with ESMTP id 29A3580016 for ; Thu, 6 Oct 2022 09:35:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1665048942; 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=go40zFr/9iiDvA5R+CukTDIZOFWbDoEwVAldJ/dw7HA=; b=YtMDQckcgqd5f7x89ot84ye+/IpmVgu2ezswwNkUzDQYeUGnsFZX3i9WZTfXqvAvoLiBW2 LbMM8B2Y1fTnue2WjpZyMCAjZt2TbG5rC8aa2+dG/cdBYSn+jPF6OHRBipDO2En4OuemdR jmCDG1wLIqBjdhEGnCWNjBuGP4eldLg= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-260-mGRmHERXM7K8uf_1kjrclg-1; Thu, 06 Oct 2022 05:35:41 -0400 X-MC-Unique: mGRmHERXM7K8uf_1kjrclg-1 Received: by mail-wm1-f71.google.com with SMTP id g8-20020a05600c4ec800b003b4bcbdb63cso752774wmq.7 for ; Thu, 06 Oct 2022 02:35:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:subject:organization:from :references:cc:to:content-language:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date; bh=go40zFr/9iiDvA5R+CukTDIZOFWbDoEwVAldJ/dw7HA=; b=uP5INASgrzEBQPJKPpOG8hLbkyBDfp6/HPn1B06KnVeD8s0ghLbRRu9u2hqSWEw6/I XHrs9u15dHSsgsyCLU/q36n91FvO2Czbs5i+tWgcG6axuS1afB3TPrmhAVQ60hvhgb79 C44tACVFnoGDxpCvGDrU1qD5aaXEhlKfRPjeTlBFyJfsdKx1u9jHmbO/cCUVeEAS54hk 6vEiBHYS8d/iigDP6esBKca+M8jfRe9RUg+cw4sPnmF6dD4wlzNcF85zYA0eayxxR6yT VW1am+c7a3+BuG1LS+Ftw2hGrdLc5TXGY4DZNWP8RV7ooFI7u5L2ff/KEs/xHgpMCcfD oFUA== X-Gm-Message-State: ACrzQf16f91QD82WLxeH3q5Mqnvremm9K5zoEWMa1xKATkp6DjARjFmf ZfvZYJb24xyMSrS+bFE7tVKcmGpaBUzirm+2STuAHGlgPGHzMMSxQm8OutiT3VoVpbtZHZhfXW1 Fp1OS4zzh/j0= X-Received: by 2002:adf:f501:0:b0:22c:cbea:240a with SMTP id q1-20020adff501000000b0022ccbea240amr2539246wro.78.1665048940462; Thu, 06 Oct 2022 02:35:40 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6FbNUZUTcpyWNZ14N4SZRoLrItztcXYWPLFvPsaCMZQ09OI7Y6HnjjTpPj6olm9G3I9db3vg== X-Received: by 2002:adf:f501:0:b0:22c:cbea:240a with SMTP id q1-20020adff501000000b0022ccbea240amr2539227wro.78.1665048940201; Thu, 06 Oct 2022 02:35:40 -0700 (PDT) Received: from ?IPV6:2003:cb:c705:3700:aed2:a0f8:c270:7f30? (p200300cbc7053700aed2a0f8c2707f30.dip0.t-ipconnect.de. [2003:cb:c705:3700:aed2:a0f8:c270:7f30]) by smtp.gmail.com with ESMTPSA id d10-20020a5d6dca000000b0022917d58603sm17203084wrz.32.2022.10.06.02.35.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Oct 2022 02:35:39 -0700 (PDT) Message-ID: <274c790a-04c7-078a-19be-851066dc21bb@redhat.com> Date: Thu, 6 Oct 2022 11:35:38 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.0 To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, Andrew Morton , Shuah Khan , Hugh Dickins , Vlastimil Babka , Andrea Arcangeli , "Matthew Wilcox (Oracle)" , Jason Gunthorpe , John Hubbard References: <20220930141931.174362-1-david@redhat.com> <20220930141931.174362-6-david@redhat.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v1 5/7] mm/pagewalk: add walk_page_range_vma() In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665048943; a=rsa-sha256; cv=none; b=qM8RMEySTnimg/krx7GPo9+NQyHeN7JWWGNseABBi7Qk7oMWKIOiqzBvg1FWX9ZzzkAfcQ QVtPLi75kTX6yAjAwyneLu5N8jIjAAjWszDuPETkcrai9AMYYFeWz9JGjSJqL65UsJTO/v UNiH5WSdmuyOu+ihErf7IsqvIpDcEdI= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YtMDQckc; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665048943; h=from:from:sender: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:dkim-signature; bh=go40zFr/9iiDvA5R+CukTDIZOFWbDoEwVAldJ/dw7HA=; b=JoJjVDgBHSWYsifTq93tmGSscC0sgQDDgUVq/it3AlVUawyDi/QzslUrryyb6Y1YqVCsJJ uFhy5Hs4aD2xJAWBBRiKOBUnAcJOiq6AtAIAEurBi2v9JzJmAGOJhgoQUA/Nf/gUJXZO94 F9smTk6OzuGpG18MSNDWbn5v2FYERl0= X-Rspamd-Server: rspam08 X-Rspam-User: X-Rspamd-Queue-Id: 29A3580016 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=YtMDQckc; spf=pass (imf30.hostedemail.com: domain of david@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Stat-Signature: ac6r9qg7wxzbm1dfrm9ej4ozqfnws6ax X-HE-Tag: 1665048943-753232 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: On 05.10.22 22:42, Peter Xu wrote: > On Fri, Sep 30, 2022 at 04:19:29PM +0200, David Hildenbrand wrote: >> +int walk_page_range_vma(struct vm_area_struct *vma, unsigned long start, >> + unsigned long end, const struct mm_walk_ops *ops, >> + void *private) >> +{ >> + struct mm_walk walk = { >> + .ops = ops, >> + .mm = vma->vm_mm, >> + .vma = vma, >> + .private = private, >> + }; >> + int err; >> + >> + if (start >= end || !walk.mm) >> + return -EINVAL; >> + if (start < vma->vm_start || end > vma->vm_end) >> + return -EINVAL; >> + >> + mmap_assert_locked(walk.mm); >> + >> + err = walk_page_test(start, end, &walk); > > According to test_walk(): > > * @test_walk: caller specific callback function to determine whether > * we walk over the current vma or not. Returning 0 means > * "do page table walk over the current vma", returning > * a negative value means "abort current page table walk > * right now" and returning 1 means "skip the current vma" > > Since this helper has vma passed in, not sure whether this is needed at > all? I kept it because walk_page_vma() similarly has it -- walk_page_vma() walks the whole VMA range. I do agree that it's kind of weird to have it like that. All users of walk_page_vma() don't use it, so we can just get rid of it there as well. Might make the walk slightly faster. > > walk_page_vma_range() sounds slightly better to me as it does look more > like an extension of walk_page_vma(), rather than sister version of > walk_page_range_novma() (which works for "no backing VMA" case). But no > strong opinion. > I matched that to walk_page_range_novma(). Now we have walk_page_range walk_page_vma walk_page_range_novma walk_page_range_vma -- Thanks, David / dhildenb