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 X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCF1DC2D0EF for ; Fri, 17 Apr 2020 14:45:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6F0F82076A for ; Fri, 17 Apr 2020 14:45:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="miJAkU8M" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6F0F82076A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0962F8E0025; Fri, 17 Apr 2020 10:45:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 048B28E0023; Fri, 17 Apr 2020 10:45:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EC56B8E0025; Fri, 17 Apr 2020 10:45:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id D0AFA8E0023 for ; Fri, 17 Apr 2020 10:45:46 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 90E15824556B for ; Fri, 17 Apr 2020 14:45:46 +0000 (UTC) X-FDA: 76717621092.10.self09_6c29ee9dff30e X-HE-Tag: self09_6c29ee9dff30e X-Filterd-Recvd-Size: 2701 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf34.hostedemail.com (Postfix) with ESMTP for ; Fri, 17 Apr 2020 14:45:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=VGjfYfYsr7Tzr48sL/qzic8xs0Swfm3p/YbsdF+bAOE=; b=miJAkU8MUsOZqJSHZb/WzB4bc/ 8FcwuOHPaJlvXK9U2XoK0U/GNWcilGkn32O6/wSZ2VToQVOePRVqQ5OeqFX0OFGczj7elaHiRsiVW KAZlb0VkVBvNGIE4G25i8S1ttHmJdjWV6KI9r/eZ0/fwJqGMaxoXcZ/1RHA1M9a3udZOhd+4dlG+3 LsMsFhxkjAAbY8D8lOBcALGa2E0ly02+2TYUh4BHVnE6bVqd1gldATiqDsz75hAKTh+R1+U29HjpY vk+cioOxFxlfMasKDfgYhRXw43pGLlGncsPf3hFuUY6U06qA05QFkTOWuE2bc59n5c84Ut6LgbPtl gykNWgVw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jPSFP-0000rK-2T; Fri, 17 Apr 2020 14:45:39 +0000 Date: Fri, 17 Apr 2020 07:45:38 -0700 From: Matthew Wilcox To: chenqiwu Cc: Michal Hocko , akpm@linux-foundation.org, linux-mm@kvack.org, chenqiwu Subject: Re: [PATCH] mm/memory: add refcount for special mapping page in copy_one_pte() Message-ID: <20200417144538.GM5820@bombadil.infradead.org> References: <1587119514-29679-1-git-send-email-qiwuchen55@gmail.com> <20200417114312.GM26707@dhcp22.suse.cz> <20200417142618.GA31882@cqw-OptiPlex-7050> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200417142618.GA31882@cqw-OptiPlex-7050> 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 Fri, Apr 17, 2020 at 10:26:18PM +0800, chenqiwu wrote: > On Fri, Apr 17, 2020 at 01:43:12PM +0200, Michal Hocko wrote: > > On Fri 17-04-20 18:31:54, qiwuchen55@gmail.com wrote: > > > From: chenqiwu > > > > > > If we get a special mapping page like device mapping page or zero page > > > when copy_one_pte, it's necessary add the page refcount count. > > > > From the changelog it is not clear what is the actual problem and how > > the patch address it. Please be more verbose. > > > I don't find any actual problem, but I think there should be addressed > to update the page refcount for special mappings include devmap and zero > page instead of doing nothing else, since we copy the pte from one task > to the other. But the zero page is special. It's never freed. So unless we're seeing a refcount problem with the zero page, I would suggest that your patch is eventually going to overflow the refcount on the zero page.