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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 02ABCC433E0 for ; Thu, 25 Jun 2020 09:57:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C3916206EB for ; Thu, 25 Jun 2020 09:57:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C3916206EB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=loongson.cn Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4CA296B0002; Thu, 25 Jun 2020 05:57:16 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 47A366B0003; Thu, 25 Jun 2020 05:57:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 368BB6B0005; Thu, 25 Jun 2020 05:57:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 1DF266B0002 for ; Thu, 25 Jun 2020 05:57:16 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id BC812D204 for ; Thu, 25 Jun 2020 09:57:15 +0000 (UTC) X-FDA: 76967281230.04.ants87_331707726e4b Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id 968518014311 for ; Thu, 25 Jun 2020 09:57:15 +0000 (UTC) X-HE-Tag: ants87_331707726e4b X-Filterd-Recvd-Size: 4088 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Thu, 25 Jun 2020 09:57:13 +0000 (UTC) Received: from [10.20.42.25] (unknown [10.20.42.25]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9Axf+judPReSJtJAA--.1308S3; Thu, 25 Jun 2020 17:57:03 +0800 (CST) Subject: Re: [PATCH 2/3] mm/huge_memory.c: update tlb entry if pmd is changed To: Mike Kravetz , Andrew Morton , Thomas Bogendoerfer , Paul Burton , Anshuman Khandual , Mike Rapoport , Daniel Silsby References: <1592990792-1923-1-git-send-email-maobibo@loongson.cn> <1592990792-1923-2-git-send-email-maobibo@loongson.cn> <07f78e99-6e59-0bce-8ac0-50d7c7600461@oracle.com> Cc: linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org From: maobibo Message-ID: Date: Thu, 25 Jun 2020 17:57:02 +0800 User-Agent: Mozilla/5.0 (X11; Linux mips64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <07f78e99-6e59-0bce-8ac0-50d7c7600461@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-CM-TRANSID:AQAAf9Axf+judPReSJtJAA--.1308S3 X-Coremail-Antispam: 1UD129KBjvJXoW7ZFykKr1xKr18Kr18Wr13twb_yoW8Xr47p3 yfGan5Jw4DKr40krs7Xw47Xr4FvwsIqFWDXr1YkrWUZ3W5Xw1Fkr97uws7Wa4UZr4rXw47 ZayjgF98ur98ZaUanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDU0xBIdaVrnRJUUUvCb7Iv0xC_Kw4lb4IE77IF4wAFF20E14v26r4j6ryUM7CY07I2 0VC2zVCF04k26cxKx2IYs7xG6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rw A2F7IY1VAKz4vEj48ve4kI8wA2z4x0Y4vE2Ix0cI8IcVAFwI0_Jr0_JF4l84ACjcxK6xII jxv20xvEc7CjxVAFwI0_Jr0_Gr1l84ACjcxK6I8E87Iv67AKxVW8JVWxJwA2z4x0Y4vEx4 A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC 0VAKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr 1lOx8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcVAKI48JM4IIrI8v6xkF7I0E8cxan2IY04v7 Mxk0xIA0c2IEe2xFo4CEbIxvr21l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr 0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY 17CE14v26r1q6r43MIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_Jr0_JF4lIxAIcV C0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWrZr1j6s0DMIIF 0xvEx4A2jsIE14v26r1j6r4UMIIF0xvEx4A2jsIEc7CjxVAFwI0_Jr0_GrUvcSsGvfC2Kf nxnUUI43ZEXa7IU56c_DUUUUU== X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Rspamd-Queue-Id: 968518014311 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.069331, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 06/25/2020 08:30 AM, Mike Kravetz wrote: > On 6/24/20 2:26 AM, Bibo Mao wrote: >> When set_pmd_at is called in function do_huge_pmd_anonymous_page, >> new tlb entry can be added by software on MIPS platform. >> >> Here add update_mmu_cache_pmd when pmd entry is set, and >> update_mmu_cache_pmd is defined as empty excepts arc/mips platform. >> This patch has no negative effect on other platforms except arc/mips >> system. > > I am confused by this comment. It appears that update_mmu_cache_pmd > is defined as non-empty on arc, mips, powerpc and sparc architectures. > Am I missing something? ohh, sparc is missing here, it not defined as empty. On powerpc it is defined as empty. > > If those architectures do provide update_mmu_cache_pmd, then the previous > patch and this one now call update_mmu_cache_pmd with the actual faulting > address instead of the huge page aligned address. This was intentional > for mips. However, are there any potential issues on the other architectures? It is not special for mips, only that fault address is useful on mips system. In function huge_pmd_set_accessed/do_huge_pmd_wp_page, update_mmu_cache_pmd is called with vmf->address, rather than start address of pmd page. regards bibo,mao > I am no expert in any of those architectures. arc looks like it could be > problematic as update_mmu_cache_pmd calls update_mmu_cache and then > operates on (address & PAGE_MASK). That could now be different.