Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp422655ybi; Fri, 31 May 2019 03:43:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqw09X1G0faqi+AqrHTjWYUH3qDey2m8g8AK2/EwBGK3Gjk4kQIykXjrc6+XC0LVWBec6543 X-Received: by 2002:a65:4306:: with SMTP id j6mr8267555pgq.418.1559299405053; Fri, 31 May 2019 03:43:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559299405; cv=none; d=google.com; s=arc-20160816; b=oSukkiuC/Cf8g/+qmNyAodJUST9VcFNSon0XThviyN10n7B1Xw3p4uCLoInEX8Mw1j mpxbeYYGjtb452XOjQ7//+4QMW+Czcr+Yqbe/SVxOd3oOnAvFlyAiAsQ3d6jthCmZSuV DgqidLXxrGvc1rIZ2JBSdXatPJsbktlyONIdzjVppxhlAJMlUoJ1wOYOkIL98r3kgesQ QfVWNN6kslKHBVZWLIo6KjZqYsvD+WvlV1ddsSb3jzhhzZEytrh+96ra7b0+7GFaBBmR i0+kvXWTpjLjfXb1Zsp08UWK5DQ1LkUSbIxXJGImGfCi8w+cXc978g0T0AlFU5/Xv2Ds aaxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=f7K/6YQSxV880DkgJ09eg6h5iBlyiK20sdzcSTZG0aM=; b=S8I0yhciISCCMyflWvTpPhbzCLtCM2gYbM4vs3djLW+zBMKKWpqAWTEIPjlDOlHFh8 BBvGNQhvjTyLqoZVbJSglaJM2yIOLcd7HNL2dzyHHDWbs+7TOssCF1PqV6DcTAkjHZJm qpm7q2+CyJzBc8tUAR7js7k8S0+rlsFxgq2+RZsTzMeOPbzONUAoTFeBJRruLzL0daar P1XspZnhhiJN4YpqFdgLdBNRe1PSCH+CuotC7EzxkngGl0BZTalv+e5uloeucgmZRtRc 0pE4SWOU4rpchc94vY8QE96/OfJTlUZKLmLVo1ix007TkrSHcmzpfdbqCuFZ+ipoLF1h 5nqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XGkP53Ss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i2si5424231pgl.282.2019.05.31.03.43.06; Fri, 31 May 2019 03:43:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XGkP53Ss; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbfEaKlK (ORCPT + 99 others); Fri, 31 May 2019 06:41:10 -0400 Received: from mail-io1-f65.google.com ([209.85.166.65]:44313 "EHLO mail-io1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbfEaKlJ (ORCPT ); Fri, 31 May 2019 06:41:09 -0400 Received: by mail-io1-f65.google.com with SMTP id s7so394395iob.11 for ; Fri, 31 May 2019 03:41:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=f7K/6YQSxV880DkgJ09eg6h5iBlyiK20sdzcSTZG0aM=; b=XGkP53SshfAPmjGlZUh6RXC8I0N9LNtD1Gjnv7hElsZCRY70TqFTw5zLekprBErZVZ kWW0cxpj4Vk8TtbhgL2/m+oJDO93uQmRsgY/3PUAHt72ui+eu+8iMoi0sbO9zp5mjhfA 1GujwFE4vKK3kFHn8SsgGZLlVsT8v4F/yInGr08a92cncLzgqLyq6eBfsYPsWvYCZ0Ih Zwia03Ei1sgEs8sRg0TKkx6I68y9yoOrNuuq1r2Ve5+NvzhE/6WwPZedH24GZrPPwrEj U+tPejHGcQjYBJptZNJZri0w0gnND+Gb+fk6g/Kx+1B2BKjDwxaCQbbHjB796JljRktB FTLg== 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=f7K/6YQSxV880DkgJ09eg6h5iBlyiK20sdzcSTZG0aM=; b=Ix34o3BTgKw3vFAOUkZLBOpuum6VtuZO7T4tw34ojv7L33xbDbOH0P4W+5v84+BVWb sbYLL+kgklpQJqYptax2T8c4ZCGnrGjl6csamOdbgSPeNBHA+WE8h4qsFTdcYzJBwbtm 5qrcG3bllTladZFgrIOxKU6qAYa09bKh43VpFYwJ0Ih5UTlQW/149YnbVLgccjC3LSms 8ARDuGPPcST0gcPieicchRfOltws8GClNmo9gKHiSTaxPYsckwGpIu+3x9+gaDDULPTS eJGuoTXw4KH1cOcRbOm0q1Ssc/5aQ/noGieexk3lnyKIrGeUGm/Js8iwwqcYqR4ew0K9 YMZQ== X-Gm-Message-State: APjAAAXPNmh/SMKABf2XoDE7/KicxTp5QE8Ng6Ov812COiL/R6w0vYR9 MoshzeIQ1xr9tm6DAu7MtZqNhzz6hIbT4e90Lw== X-Received: by 2002:a6b:e005:: with SMTP id z5mr4968657iog.161.1559299269094; Fri, 31 May 2019 03:41:09 -0700 (PDT) MIME-Version: 1.0 References: <1559170444-3304-1-git-send-email-kernelfans@gmail.com> <20190530214726.GA14000@iweiny-DESK2.sc.intel.com> <1497636a-8658-d3ff-f7cd-05230fdead19@nvidia.com> <20190530235307.GA28605@iweiny-DESK2.sc.intel.com> In-Reply-To: <20190530235307.GA28605@iweiny-DESK2.sc.intel.com> From: Pingfan Liu Date: Fri, 31 May 2019 18:40:57 +0800 Message-ID: Subject: Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast() To: Ira Weiny Cc: John Hubbard , linux-mm@kvack.org, Andrew Morton , Mike Rapoport , Dan Williams , Matthew Wilcox , "Aneesh Kumar K.V" , Keith Busch , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 31, 2019 at 7:52 AM Ira Weiny wrote: > > On Thu, May 30, 2019 at 04:21:19PM -0700, John Hubbard wrote: > > On 5/30/19 2:47 PM, Ira Weiny wrote: > > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > > [...] > > >> + for (j = i; j < nr; j++) > > >> + put_page(pages[j]); > > > > > > Should be put_user_page() now. For now that just calls put_page() but it is > > > slated to change soon. > > > > > > I also wonder if this would be more efficient as a check as we are walking the > > > page tables and bail early. > > > > > > Perhaps the code complexity is not worth it? > > > > Good point, it might be worth it. Because now we've got two loops that > > we run, after the interrupts-off page walk, and it's starting to look like > > a potential performance concern. > > FWIW I don't see this being a huge issue at the moment. Perhaps those more > familiar with CMA can weigh in here. How was this issue found? If it was > found by running some test perhaps that indicates a performance preference? > I found the bug by reading code. And I do not see any performance concern. Bailing out early contritute little to performance, as we fall on the slow path immediately. Regards, Pingfan [....]