Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp606928ybz; Wed, 15 Apr 2020 15:02:44 -0700 (PDT) X-Google-Smtp-Source: APiQypIImzybaJ/++8BHkIhKHx3yoFN6Nw4E4ZUsvxfQvvV+8NPGpMWUOLjUDZyOpRO4HdfJx/JG X-Received: by 2002:a17:906:7e19:: with SMTP id e25mr7273832ejr.358.1586988163917; Wed, 15 Apr 2020 15:02:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586988163; cv=none; d=google.com; s=arc-20160816; b=bzUSQm9Wp7oNa82mqlJT98MBPizVOuYQWLPmo9RvD/LDgn+k8VyhyRFVAwmZncK7E5 92iNIh4sYLJ3+lLcUBEMTE3ImxFrbT63CQieQssUUgJ7DpNROhN291LsA3WD2eks5B13 HQoxVvPuc+MgGEBXutVPQEEcT3gazd2bO06N9jJvUgkhZBEVbNQ+nFFf5ISafmoCtnD8 P45tSrMiUu7NSGHh/pwSEJJAb8ZX38nofGskTTlqza5UiwjvFL68VQipKEGMOpuJ2O3e InR+d2/DHjMEOLdLY+Aa2nzhfv1J/fMy1higWKUUH3wjt/cG3JJuoK2bKgsxEEq8Gs0s zPBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=qTZY0os6at1npMB2sob6j3xFufXnjCkxklf/oSH4Ng4=; b=rtCi1DA+muJMF0wynA87iiWcJM10n+lmSQkTdSmzrVtUYvnDqBmjrBqCg5W03TJixH 6SCiMUo9Ce3bBgtPuDOCjvNfQ7FpGeghOOGPb5n3Kz+LPPqgIgjoRxWFmTqLA2obWatj xlvDnwJDHHtqBaYDKtxdqG/tpCbL7cswHlAh4T/itMEXSSHQyNGSGwsw1HgAxRtYZu8Y AJiilAv+GK4L0tAJBUKGQs5KcAL0dIOYgjw8Mf1tUACoh5cn6jDoa9waqlq0DtF81vON G4MstMpM79gsOBGVambF0/fUyRIPKFUA9hU7SFJ3zB7o4sSRFKK7PvWMf9uS2hp26ZZK y4xQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=J2Zg0lkj; 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=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b3si10603371edn.402.2020.04.15.15.02.20; Wed, 15 Apr 2020 15:02:43 -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=@nvidia.com header.s=n1 header.b=J2Zg0lkj; 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=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407926AbgDOCmv (ORCPT + 99 others); Tue, 14 Apr 2020 22:42:51 -0400 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:12129 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391714AbgDOCml (ORCPT ); Tue, 14 Apr 2020 22:42:41 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Tue, 14 Apr 2020 19:40:50 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Tue, 14 Apr 2020 19:42:39 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Tue, 14 Apr 2020 19:42:39 -0700 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 15 Apr 2020 02:42:39 +0000 Received: from [10.2.85.126] (10.124.1.5) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 15 Apr 2020 02:42:38 +0000 Subject: Re: [PATCHv3, RESEND 5/8] khugepaged: Allow to collapse a page shared across fork To: "Kirill A. Shutemov" CC: "Kirill A. Shutemov" , , Andrea Arcangeli , Zi Yan , Yang Shi , Ralph Campbell , William Kucharski , , References: <20200413125220.663-1-kirill.shutemov@linux.intel.com> <20200413125220.663-6-kirill.shutemov@linux.intel.com> <0efcc512-6f12-1ff0-9885-871172fac766@nvidia.com> <20200414213526.ecn3zcgnqxoveddq@box> X-Nvconfidentiality: public From: John Hubbard Message-ID: Date: Tue, 14 Apr 2020 19:42:39 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200414213526.ecn3zcgnqxoveddq@box> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1586918450; bh=qTZY0os6at1npMB2sob6j3xFufXnjCkxklf/oSH4Ng4=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=J2Zg0lkjZUPsttHoKMtn9tpNoDDxi1U92V00cmqjG/PpxSoMtE8eYf5XO9sNHBsIH 6vglRMiJNVizuNVNNZL0AtGHFIcJFipXPZUBBZwi4LRD3eKXA9N2yWohAOvv9UHJuU QkwyRj9HHf5/iqlqbeHn5+DqAcE4CfpiQ7ojVy/uqe6JK1SqCdozN+XF0LWEFKfflW QYUyE4JNZOM70r5B+RJ6/zX/pn+8XHydqN6N79BrwBljvsYKWrkJ1YXnckWE57evIT mtQiI0DdUGUJ38Ftrf1dM/iMTNd8FjvOwTkRJdu+Jei7quFJl9cW7iJGsjTM0B7xoj RyByOosLIt8sQ== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-04-14 14:35, Kirill A. Shutemov wrote: > On Mon, Apr 13, 2020 at 01:48:22PM -0700, John Hubbard wrote: > > [Thanks for all your suggestions and corrections] > >>> + if (IS_ENABLED(CONFIG_DEBUG_VM) && expected_refcount > refcount) { >>> + pr_err("expected_refcount: %d, refcount: %d\n", >>> + expected_refcount, refcount); >>> + dump_page(page, "Unexpected refcount"); >> >> >> I see two issues with the pr_err() and the dump_page() call: >> >> 1. You probably want to rate limit this, otherwise you'll have a big >> problem if lots of pages are pinned! > > Nope. Only if kernel is buggy. See below. > >> 2. Actually, I don't think you'd want to print anything at all here, even with >> rate limiting, because doing so presumes that "unexpected" means "wrong". And I >> think this patch doesn't expect to have GUP pins (or pin_user_pages() pins, ha), >> but that doesn't mean that they're wrong to have. > > See condition. We only do it if refcount is *below* expected refcount. It > should never happen. Pinned page would have refcount above expected. > Yes, you are right. I misread the condition. This actually is just right. :) thanks, -- John Hubbard NVIDIA