From patchwork Sun Apr 19 03:30:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11497083 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 208CB14B4 for ; Sun, 19 Apr 2020 03:30:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E1CB121973 for ; Sun, 19 Apr 2020 03:30:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Y1at++HC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E1CB121973 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 6CB4B8E0006; Sat, 18 Apr 2020 23:30:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 655A78E0003; Sat, 18 Apr 2020 23:30:27 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4F7B08E0006; Sat, 18 Apr 2020 23:30:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0191.hostedemail.com [216.40.44.191]) by kanga.kvack.org (Postfix) with ESMTP id 38AC28E0003 for ; Sat, 18 Apr 2020 23:30:27 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id EF4BF824556B for ; Sun, 19 Apr 2020 03:30:26 +0000 (UTC) X-FDA: 76723176852.15.part15_3e3076228c62 X-Spam-Summary: 2,0,0,91532e94999befa6,d41d8cd98f00b204,qiwuchen55@gmail.com,,RULES_HIT:41:355:379:541:800:960:967:968:973:988:989:1260:1345:1359:1437:1534:1540:1711:1714:1730:1747:1777:1792:2393:2525:2559:2563:2682:2685:2859:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3350:3369:3865:3866:3867:3868:3870:3871:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:5007:6261:6653:7576:9025:9413:10004:11026:11658:11914:12043:12296:12297:12517:12519:12555:12679:12895:12986:13069:13311:13357:14181:14384:14394:14721:21080:21444:21451:21627:21666:21740:30054,0,RBL:209.85.216.67:@gmail.com:.lbl8.mailshell.net-62.50.0.100 66.100.201.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: part15_3e3076228c62 X-Filterd-Recvd-Size: 3612 Received: from mail-pj1-f67.google.com (mail-pj1-f67.google.com [209.85.216.67]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Sun, 19 Apr 2020 03:30:26 +0000 (UTC) Received: by mail-pj1-f67.google.com with SMTP id t9so907375pjw.0 for ; Sat, 18 Apr 2020 20:30:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=xMlQRVMMniql1Vu9yswJ+ixfJanqNX2NEW3Q7yBOscY=; b=Y1at++HCtHN1+5ZVb4XGfaQYDM3rsX2R1jQ/28SUASBfEdmSmJfGmkfvSkBwHsXPQu 5+cEUJuyOeI9IsE3TbD3/LcK2deYWxvtlJg8LIEQVaXuPnMQ7dKy5SZ/c4roWURZ+U9V 0Fr4QElTvUn7OSpAGo1w/ygi3vEwyl3I00DfoPxjf7/RXOdeA6gkY/JjdNEp1nCstg+0 jnhJr8dvmjqnpZ+q8CFeDvmYYibVUNgCobPIf8pVI+C7AkY2UdcRK3rCIeZ8Ggl4uslM P1Vopzio82geCgRD+YIjNcODOQAuUpYtHCVgIx4NZhoTef3t1yn5yZE7/3tASybkn/UV sbnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=xMlQRVMMniql1Vu9yswJ+ixfJanqNX2NEW3Q7yBOscY=; b=CYOz2utLxJy/kSf3mO7nMzfBTqe/4KpjOuJpwrr3sb5GngTmijxf9NucvhpWSgk/Ki ldekjxdluwof+OFSIC2MGzICfEe3eaviYU5QriYOfHlroKNA8cmRhO8zJWm9SngR8wlH /loa5Sigjma+t3nSvu48e6O4V4FmZTS1I4sBX9qVThCMdlMFFUJkGAHafxqkp8SlbpmU xGqpPBKDTeMHW8fIZHzNpWdnSsyNgDZra2aJa2yCFsWdGNCJiqucDLXkul2/DWSQD3f/ DIyIPg1h7yc7DEDSBG5I0KSvTNhoVQKblvizmo9M3/NaEZZ0ePHtj1t8qsx4Lcy70uOE cVkg== X-Gm-Message-State: AGi0PuaQIbze3cM29sAHMR+kzsEJhl1e++VT4cuA0urYU29HEWJH8Y8Q 74LOiz3opbDUk6ZzzaZdNB8= X-Google-Smtp-Source: APiQypI1DTTAAJ95ENgLoAw5yl+RREy/o3PwH+VxB8fQuGiTbsyNdyGy+6UGH6/acVQqVZtZhAhcNw== X-Received: by 2002:a17:90a:8a14:: with SMTP id w20mr13814653pjn.176.1587267025922; Sat, 18 Apr 2020 20:30:25 -0700 (PDT) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id j5sm9855785pjb.36.2020.04.18.20.30.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 18 Apr 2020 20:30:25 -0700 (PDT) From: qiwuchen55@gmail.com To: akpm@linux-foundation.org, mhocko@suse.com, willy@infradead.org Cc: linux-mm@kvack.org, chenqiwu Subject: [PATCH 2/2] mm/memory: put refcount of normal page in zap_pte_range() Date: Sun, 19 Apr 2020 11:30:17 +0800 Message-Id: <1587267017-25310-2-git-send-email-qiwuchen55@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1587267017-25310-1-git-send-email-qiwuchen55@gmail.com> References: <1587267017-25310-1-git-send-email-qiwuchen55@gmail.com> 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: From: chenqiwu As discussed in patch[1], there is an imbalnace of normal page refcount between copy_one_pte() and zap_pte_range(). This patch put the refcount of normal page back in zap_pte_range() to fix the imbalance. [1] https://patchwork.kernel.org/patch/11494691/ Signed-off-by: chenqiwu --- mm/memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memory.c b/mm/memory.c index 2143827..ec8de9a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1088,6 +1088,7 @@ static unsigned long zap_pte_range(struct mmu_gather *tlb, } rss[mm_counter(page)]--; page_remove_rmap(page, false); + put_page(page); if (unlikely(page_mapcount(page) < 0)) print_bad_pte(vma, addr, ptent, page); if (unlikely(__tlb_remove_page(tlb, page))) {