From patchwork Sun Apr 19 03:30:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chenqiwu X-Patchwork-Id: 11497081 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 032D914B4 for ; Sun, 19 Apr 2020 03:30:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 90EA5218AC for ; Sun, 19 Apr 2020 03:30:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="EauYzWLy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 90EA5218AC 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 0FECA8E0005; Sat, 18 Apr 2020 23:30:25 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 088EC8E0003; Sat, 18 Apr 2020 23:30:25 -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 E92568E0005; Sat, 18 Apr 2020 23:30:24 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0198.hostedemail.com [216.40.44.198]) by kanga.kvack.org (Postfix) with ESMTP id CD38B8E0003 for ; Sat, 18 Apr 2020 23:30:24 -0400 (EDT) Received: from smtpin29.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7F668824556B for ; Sun, 19 Apr 2020 03:30:24 +0000 (UTC) X-FDA: 76723176768.29.bat16_384dfee9ed31 X-Spam-Summary: 2,0,0,4ff12cd714ff8bed,d41d8cd98f00b204,qiwuchen55@gmail.com,,RULES_HIT:41:355:379:541:800:960:967:968:973:988:989:1260:1345:1437:1534:1539: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:3865:3867:3870: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:21433:21444:21451:21611:21627:21666:21740:30054,0,RBL:209.85.216.68:@gmail.com:.lbl8.mailshell.net-62.18.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:24,LUA_SUMMARY:none X-HE-Tag: bat16_384dfee9ed31 X-Filterd-Recvd-Size: 3340 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Sun, 19 Apr 2020 03:30:24 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id e6so514579pjt.4 for ; Sat, 18 Apr 2020 20:30:23 -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; bh=vQm57wKfvcWYOKg9PC2RGK02bJjZrkza17rZZuyCtW8=; b=EauYzWLyE79rkeiRv1FP97gw7jg9xzMf8MNV4dEInJDWYiyWX8izVft1E//Vyh5oZ4 0yhnvsN/vv02Inl+5kaJrx+4iznxfkatyH/DqKcZ3rSqXN/oHgJAyeeWWcmK+ll9w0Gt WlJE4tyV6toy2QrER7cx8E0xFxTmB624PStnl69QNFobPjwVUlgF5bpW4HTH2BuFd2zn 8iVXjzbIJNGd7NIwcF2W+kWB+/S7JgMGhGXWwlnBOMJfLWgBPRpupCHUBYFpTnx4tyoz DAjAaBj82b5tJCp07cDkQqvs3DLI4kbfMOIS6AAE25HqyN3km3PckXY9lwK/M2Kr4aYf 1s4w== 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; bh=vQm57wKfvcWYOKg9PC2RGK02bJjZrkza17rZZuyCtW8=; b=nyD8JcgjbDG9LIRp5Fpyz8tbgsnZGERgTVhJFma0LLYLoo2/3QdrsXxjMv59eJsGjO 2rn3yTHyJgFaRNjWKlbZhIFm3dHOvz/zAfWKa5piCWq2Rrid8uJF73LxMrwBobWVkkKa lzK69mIEVWeRaDZMLDifx/244BRAvBR//aO/xNesAdevfAhxU76JWJYG7HtwpmE7EaWl 1IZFo0RPJ1DRRAXyJ9/JslKRFlOZT3q9LA2bMlWuw9coKdzeZ5w/dfVBdqn0WcB8gpyA iSZdD4C67KvJShMt8RlualBlz1cuvb2l4QUlZg1BBa1uAiaixVVdC3EJc6vy/Qos6c1q S8Cw== X-Gm-Message-State: AGi0PuZLNYpNdmm4hd984/9/SjjZc4/zXoMXVvgARbbbk8Svq2BU/onw GzgLzBgqFiM3oTkreP3qf54= X-Google-Smtp-Source: APiQypLAX/0e7YnwzCgNUZK9d+DNQPCtk2YFwy48g0fDmxJMsl2pf5oowwkdmpurpF53yjAS3WZ01A== X-Received: by 2002:a17:902:b685:: with SMTP id c5mr11316699pls.323.1587267023142; Sat, 18 Apr 2020 20:30:23 -0700 (PDT) Received: from localhost ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id y123sm22996817pfb.13.2020.04.18.20.30.21 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Sat, 18 Apr 2020 20:30:22 -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 1/2] mm/memory: remove redundant pte_devmap case for copy_one_pte() Date: Sun, 19 Apr 2020 11:30:16 +0800 Message-Id: <1587267017-25310-1-git-send-email-qiwuchen55@gmail.com> X-Mailer: git-send-email 1.9.1 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], special mapping ptes such as device mapping ptes don't need to operate on their corresponding pages, so the redundant pte_devmap case can be removed. [1] https://patchwork.kernel.org/patch/11494691/ Signed-off-by: chenqiwu Reviewed-by: Matthew Wilcox (Oracle) Acked-by: Michal Hocko --- mm/memory.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/mm/memory.c b/mm/memory.c index f703fe8..2143827 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -802,8 +802,6 @@ struct page *vm_normal_page_pmd(struct vm_area_struct *vma, unsigned long addr, get_page(page); page_dup_rmap(page, false); rss[mm_counter(page)]++; - } else if (pte_devmap(pte)) { - page = pte_page(pte); } out_set_pte: