Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2055569pxu; Fri, 18 Dec 2020 04:35:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuFkFV4sVgQVvhpDrYHUjmkw6Ku6bAbq6hUEkwfbToLTlwkNxcywOJ7NRhXgMwcAWihjtU X-Received: by 2002:aa7:c603:: with SMTP id h3mr4242435edq.254.1608294932844; Fri, 18 Dec 2020 04:35:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608294932; cv=none; d=google.com; s=arc-20160816; b=KoMYVO6SnGlwWwLYamkl5mOzISryr4JYGOwYbO+tmAVpXZNRD0NDaDs2AhLChlVt2B Yuz38oDukzQxcZTXxz5G1YrWFHC97tV6I7V7gJVfuDaxw9Whp11OEun9083eVm5z/WeF NicCm8PvpzWjoOtTquXiYYqiGK/XysTNu+jY1/cAXag+K6OpcvIO6LohfiB2ZiF8mNqu E38vU1ZGcKNaWW1AZl1imY6FeHgv211QJ/7SUaY39yxrHuUiIdHWex7L9hdnuGz3eqdP 2RjtEFXqOLgqGv0haAJgTEN08KwojevYk5TidwSm4/qpwQFWrwOB1onxDnZbz+wBInaJ Mwtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=i4auixzjhc3l5kGc5mD15oPo8KZORVAz4eHOnG9WGUU=; b=FKfiamLGoYaH7KmzWiG0rqHMU0JWXIyoz5hn2rsNzE3GpPwWMkjfoX3Ok5ij8GPnzh XD4IwMlWhaEfWcXAGSev320LQZM698kGd7VaNp0OygVOlhSmh0BB2eEKGYtcDK07V4is p2Zp3gU76IACTvz9D3Yft85Gy7LD60k43l49QTvoBFia2Uklz6fEOQdkJqJhg1j8IviZ oy5LF8rPUtq8hkjA1X46Ub0enA16y6Ex+6QvIVrwaXtjtdFiIFfSEpS/xi6iuqLuE2cO FiSABox9HYLQyAjCn5F6rxmZGCerFE0fxZCZdCNG3YUgT06dxV9di4U/2N9cHwq+jNGO Befw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@soleen.com header.s=google header.b=n6tUjhd4; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h12si4455768eje.122.2020.12.18.04.35.09; Fri, 18 Dec 2020 04:35:32 -0800 (PST) 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=@soleen.com header.s=google header.b=n6tUjhd4; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725996AbgLRMdy (ORCPT + 99 others); Fri, 18 Dec 2020 07:33:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbgLRMdy (ORCPT ); Fri, 18 Dec 2020 07:33:54 -0500 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACC2FC06138C for ; Fri, 18 Dec 2020 04:33:13 -0800 (PST) Received: by mail-ed1-x52c.google.com with SMTP id j16so2202034edr.0 for ; Fri, 18 Dec 2020 04:33:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=soleen.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=i4auixzjhc3l5kGc5mD15oPo8KZORVAz4eHOnG9WGUU=; b=n6tUjhd4sqvhp8M2z4j5VFSxJeotpjxPd0CPZa5/EEkcoeLyfyDskake0eK9yxhmwy S2gV2oOJzviGu9Y+HT1JnquGMls/BLX+jC+HgjKoBbCtEGWktMPT2nMVHOoLhLl0KgvG peXy3mP/v5o9GPyQ8zCeJENiWt244Qtx5yIrpCIXKcHHLKce5fQ7WLALIl8MpgCHKKD0 q1lOXUYw01ZQ5n/Hzb1tToYlIWOWHfXBaEMR8L39XIv4/BPtOJ3zfKkyuTXHwcwSFoiD GbfceUFPcWfb8QPWxwJ3/wFiCvhjXjbRR2moF52UiyqMkdZSC0eRi45AU3BnsQyx5mMJ 1t7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=i4auixzjhc3l5kGc5mD15oPo8KZORVAz4eHOnG9WGUU=; b=oPZaG0dgeGCKtTcZdmswpo5A7TtFAD7yZjkxEZa4HTgCTAG+6cCjiWOSWA47mqXZKa wy9rv3rMkib+JCoOfU8/CczhXUAcn6xYKpXusMOmh5fHeTeweE018J/Qmm4E0X97mr91 VWdM3d6IvTn37I75ERUUYVO+npTZSfM6uTSR3qQ8AJmAOuKCT2/IzsccTKAF1BSnBRmq ddL2H53ZcbVC/1bYJQvtCqG5UlfBnMMWzE7qhGqrRc5BrPSiCNzdB4XQKl2Jn93NQi1t 5TdPXbPQL4qzFcO58CP/pgLnolRsK5apfvqtFFrC9ns8Pzq4NO6Yh9JsNqXpD5VojjRx NdHA== X-Gm-Message-State: AOAM530STscbxyj9CBjJ9aIc363X9kKI3HKlT2qswLcYlYrRDjFur5Q9 eJwo6a3PG+xDCPTdTbBBm4fiDjSAQ9TTCRq6G9HY8g== X-Received: by 2002:a50:f404:: with SMTP id r4mr4201011edm.62.1608294792260; Fri, 18 Dec 2020 04:33:12 -0800 (PST) MIME-Version: 1.0 References: <20201217185243.3288048-1-pasha.tatashin@soleen.com> <20201217185243.3288048-8-pasha.tatashin@soleen.com> <20201218095058.GV32193@dhcp22.suse.cz> In-Reply-To: <20201218095058.GV32193@dhcp22.suse.cz> From: Pavel Tatashin Date: Fri, 18 Dec 2020 07:32:36 -0500 Message-ID: Subject: Re: [PATCH v4 07/10] mm/gup: change index type to long as it counts pages To: Michal Hocko Cc: LKML , linux-mm , Andrew Morton , Vlastimil Babka , David Hildenbrand , Oscar Salvador , Dan Williams , Sasha Levin , Tyler Hicks , Joonsoo Kim , mike.kravetz@oracle.com, Steven Rostedt , Ingo Molnar , Jason Gunthorpe , Peter Zijlstra , Mel Gorman , Matthew Wilcox , David Rientjes , John Hubbard , Linux Doc Mailing List , Ira Weiny , linux-kselftest@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 18, 2020 at 4:51 AM Michal Hocko wrote: > > On Thu 17-12-20 13:52:40, Pavel Tatashin wrote: > > In __get_user_pages_locked() i counts number of pages which should be > > long. > > Do we know of any caller who would like to pin so many pages it wouldn't > fit into an int? I suspect this is more to sync types of nr_pages and > the iterator right. It would be better to be explicit about this in the > changelog. It is to sync types. I will add it to the changelog. But, in general 32-bit increasingly becomes too small for handling page count proportional values. It is 8T for npages. For pinning may be a bit too large today, but I can image RDMA this size in the future. > > > Signed-off-by: Pavel Tatashin > > Acked-by: Michal Hocko > > > --- > > mm/gup.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/mm/gup.c b/mm/gup.c > > index 591d8e2dfc70..1ebb7cc2fbe4 100644 > > --- a/mm/gup.c > > +++ b/mm/gup.c > > @@ -1481,7 +1481,7 @@ static long __get_user_pages_locked(struct mm_struct *mm, unsigned long start, > > { > > struct vm_area_struct *vma; > > unsigned long vm_flags; > > - int i; > > + long i; > > > > /* calculate required read or write permissions. > > * If FOLL_FORCE is set, we only require the "MAY" flags. > > -- > > 2.25.1 > > -- > Michal Hocko > SUSE Labs