Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp2519279pxt; Mon, 9 Aug 2021 02:25:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzkETdvX/W5J2GjZo7l+P6GvlifcOrJ4JM2xL5GqW8PEgu8vsHrCoYzC9947nxI1Do86Nf7 X-Received: by 2002:a05:6602:2814:: with SMTP id d20mr187706ioe.65.1628501128583; Mon, 09 Aug 2021 02:25:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628501128; cv=none; d=google.com; s=arc-20160816; b=W0WJIkfMGqRYob6CJAqaz44VwiJpcBMnmYUiwIb5a2Z9PS5FFyx8pwo+63REoyqNja Td6BbUZYQbiHRFif96r90A6rXV4YfcBHWNISOA6la+teCPVMSIE1qYtjQg1NxDyV6GLz bWa1VSs2r3FI0KaZw9ohutPuFlQ+LLEkyjHNPTyqcUiB+dbl9qjZbXcqYsfn/Fyfe2IP z7h4hzJUiRk205bH6FcyaLlw7EnlKkGPMgeJPEzibu82K3WC4quoC0zUm5PAMZxgo8MY sSIGFbvQqhE5rxHwmplA4E93IB/G3/N+i3vcQTQw0efqDpC/oG0OLBGqxXS96/4mTLyV hJWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=Gf5zAZTKDCzUjBi4iBqzapJeQmqdwtpc/dVF+3UUB7I=; b=UBdFFNDqM8VD0BN6vqMQCz8wB85xNSy66S0UmzMfvw/ekS28wkxYV7/tP5D4zJA5sP +OhaMMUdA7zZJAY8h04M0oET0X/F+BikEwD7Hh388t8PkQ5sOpQeKVQMFqoJAtU/dD1k FFI5H7PZzYJXUuIJ9XnXCKZAg9rlzyJpwAEHLE3l6QnZrO3Zx+MVg0sNnltUaE2u32Ih p3LkjcBn8TCPVmIneob78+ApWqtDwUV0jtK7+lHIEYvAt/jTzzFUiGeL+67gfR4TQRHD DbbpiuUWHQCVyU0K4KFWjXi57rGP7/nEN5M0iHWsy/mgq0T02AqCd5Iu/OfsCRXOk/Qa 7VFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SzmFvhCx; 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 d2si10129380ioi.55.2021.08.09.02.25.17; Mon, 09 Aug 2021 02:25:28 -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=SzmFvhCx; 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 S234232AbhHIJYr (ORCPT + 99 others); Mon, 9 Aug 2021 05:24:47 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:44350 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234285AbhHIJYp (ORCPT ); Mon, 9 Aug 2021 05:24:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628501053; 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=Gf5zAZTKDCzUjBi4iBqzapJeQmqdwtpc/dVF+3UUB7I=; b=SzmFvhCxtRzkcKEDzDslWos6ohQBjNKQV7k5Gh5L5nrOZT+Ddb82RaxicKIUlToYMGNabA MBomgRIkKuJ3DbrwlaYqrl+pdEdHvULaFp/9+1mZ59z4G6Q9L0CWzH+rML2GqtTH4BY2dD e/9EpnhB190tb1p3upcePx3iRE2q5U4= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-342-RpDOaQtWMPqL42R9CO_2Bw-1; Mon, 09 Aug 2021 05:24:11 -0400 X-MC-Unique: RpDOaQtWMPqL42R9CO_2Bw-1 Received: by mail-wm1-f72.google.com with SMTP id j204-20020a1c23d50000b029024e75a15714so4427344wmj.0 for ; Mon, 09 Aug 2021 02:24:11 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=Gf5zAZTKDCzUjBi4iBqzapJeQmqdwtpc/dVF+3UUB7I=; b=FbHGKbV5Uf8vmv8bowMXaEB4gB4F0KtiPKuHj2dGssswT7ANuScDTVWz/y9UmMUP9t l4jltlVwvqgKUSlj8g2KUv/ZQV0M3X2c9sPZiuBJKDEgzNc0sGnn5uZj8nHZvfu6VQWk yH7y+p5KPKif4vbtQlNCEc0TTDBUgUdql9du5btSVp2di1bA6cOjrdtAg6hRWXk08U0z T+5jdrmVAqoRJUh6+tNgEfIkCst60EuG7ZfMbps6DswEUBldjfRJ816dj57wc7Wg/DBJ ER3naCPgot8R+RTSOFKy9F0JwWrJwCBnaYMUawToVNvOnr9zPwuYPWyxziKIAIejpool 84Og== X-Gm-Message-State: AOAM5318w7NBbg1pdfsYET+4Bf7Y916qFIpN1scP9jv0idC7N7XDyNJ/ GVaA9oXEs71FGlGVBTBEOMu2TKmm8Zltl5/rrJ9VDdFVGkUGAuWnzaBKqtTDOaqpJsPvI2MeXA2 stLUvTLHjxXGywMOlKLgWZsK2sGRo9jxbDvnnP3OMPGR0+rLHpTYZ5WViiokNkZ+lMvnMhtHL X-Received: by 2002:a5d:5147:: with SMTP id u7mr24081662wrt.181.1628501050656; Mon, 09 Aug 2021 02:24:10 -0700 (PDT) X-Received: by 2002:a5d:5147:: with SMTP id u7mr24081636wrt.181.1628501050466; Mon, 09 Aug 2021 02:24:10 -0700 (PDT) Received: from ?IPv6:2003:d8:2f0a:7f00:fad7:3bc9:69d:31f? (p200300d82f0a7f00fad73bc9069d031f.dip0.t-ipconnect.de. [2003:d8:2f0a:7f00:fad7:3bc9:69d:31f]) by smtp.gmail.com with ESMTPSA id n3sm16747084wmi.0.2021.08.09.02.24.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 02:24:10 -0700 (PDT) Subject: Re: [PATCH 5/5] mm: gup: use helper PAGE_ALIGNED in populate_vma_page_range() To: Miaohe Lin , akpm@linux-foundation.org Cc: imbrenda@linux.ibm.com, kirill.shutemov@linux.intel.com, jack@suse.cz, jhubbard@nvidia.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210807093620.21347-1-linmiaohe@huawei.com> <20210807093620.21347-6-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat Message-ID: <60e83492-db02-4c73-1fd4-e1f2ba383cfe@redhat.com> Date: Mon, 9 Aug 2021 11:24:09 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210807093620.21347-6-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07.08.21 11:36, Miaohe Lin wrote: > Use helper PAGE_ALIGNED to check if address is aligned to PAGE_SIZE. > Minor readability improvement. > > Signed-off-by: Miaohe Lin > --- > mm/gup.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/mm/gup.c b/mm/gup.c > index 8c89e614d4aa..802a3deb50cd 100644 > --- a/mm/gup.c > +++ b/mm/gup.c > @@ -1471,8 +1471,8 @@ long populate_vma_page_range(struct vm_area_struct *vma, > unsigned long nr_pages = (end - start) / PAGE_SIZE; > int gup_flags; > > - VM_BUG_ON(start & ~PAGE_MASK); > - VM_BUG_ON(end & ~PAGE_MASK); > + VM_BUG_ON(!PAGE_ALIGNED(start)); > + VM_BUG_ON(!PAGE_ALIGNED(end)); > VM_BUG_ON_VMA(start < vma->vm_start, vma); > VM_BUG_ON_VMA(end > vma->vm_end, vma); > mmap_assert_locked(mm); > Making it look more like faultin_vma_page_range(), nice :) Reviewed-by: David Hildenbrand -- Thanks, David / dhildenb