Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2411250pxp; Mon, 7 Mar 2022 15:01:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJyeKA+/fT0JZNTIBaYAJfXLSF7pPHXyHSLvvtMePMUbPFQZTwOdMtvqqf0RDJcygr24BwRT X-Received: by 2002:a17:907:3da8:b0:6da:9e3a:b69 with SMTP id he40-20020a1709073da800b006da9e3a0b69mr10734581ejc.76.1646694085596; Mon, 07 Mar 2022 15:01:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646694085; cv=none; d=google.com; s=arc-20160816; b=s6LXkVj8tdHERY8xGtQkzePEVydgo4+gbaYD5/dfBldB0FgEaoPEMaWpFNrGZ66slq O6W90sfrnxJG9cb0jUiI0NpOfHAXcv9y/CV3heT1R+cx9n6s8xREEC1Q/J6SAq59vXsx +qDrwGLcG2GN50biJ18PA5pWZA5IVJpipXBRDauAF0L0qYdNConpz4P4vZrK2zj/cJd6 bT6q/1Ct/3mU7L5VwGJOSsffG/ck4wq32INxTRmWr5972cI6f7ZHvqGAzRYog9wKUj5p S7jgR9qHXl6vtaK6tJH2JaOc/WrjezURYyq6w6jAWMOFSeElmH3jNfY+13y4DRHdRWvZ bYiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+qJa4E2aNjebCLgaBuko03Rvfy9kFRH0QYI+sb9D/o0=; b=0/00eS33DWjXfQKBRr/23bCuMNOV+KfqJWztXHb2LCd4JRLEwmMgdJ0lM1wr0XIHOA jHP21E9YKm0J2xnv9ml/aHCwvpYqRURe5891M7L54F9r4/UVNYFirHICY1s1zuaXebbi ZEy/0ONBtYbgoHbNzrn9z8WsN5tArOXkkWF4tkAje5tO/MObq5OgwWqC1ZlSE6hwDGD4 soTuywclvOgO8ggdn1wiIMaamRdn1RCnr8qkbhudhkq5/aLck8h1CuenNBzAVqOnn1es 8tPPATWUKCLz9mHL9YgSxxqyEjofuggRpV8xmEjh59r2QkmXrX38m2LH7hqBWTD6A642 r71w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G8OoRzp4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v6-20020a056402348600b0041634d36fecsi4424039edc.112.2022.03.07.15.01.02; Mon, 07 Mar 2022 15:01:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=G8OoRzp4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244924AbiCGWFP (ORCPT + 99 others); Mon, 7 Mar 2022 17:05:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240188AbiCGWFK (ORCPT ); Mon, 7 Mar 2022 17:05:10 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3741042EDE for ; Mon, 7 Mar 2022 14:04:16 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DB126B81729 for ; Mon, 7 Mar 2022 22:04:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D62BC340F4; Mon, 7 Mar 2022 22:04:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646690653; bh=tHzv3jXO/6WBy7nP3aIzA2cZjv9B8tpQxuj2TUQdmLM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G8OoRzp4f0iPxFf6cm65htHnUT4HipPAgoKJr596kXYRr3tyJQonSF7NY/BY8occ1 XREVLo81Z0rHwht20zE4NO9kXuvvOs1PoHQDM8lwP1TFIn6NzIVLr28fQJ/U/5NYs4 JhD5z7THsdptDiRzwc79pQh1dB5RntXhWFIMy2xm1Mo240mTQE69msoQQYUuloQams Z2EcNSmGBUTj3belAl62BneBSyOGG8TINYXblE9gMOzOKpwLQhQe5WZhXN0JgTMMWp JyjCh29AO97eeDDEGJmG2YZgrO0alSb715c6X45MNti5mK1f/iEyb0dUO4dw7bhnN6 ooILn0O4zOq7Q== From: Will Deacon To: mike.kravetz@oracle.com, osalvador@suse.de, rientjes@google.com, mark.rutland@arm.com, Muchun Song , akpm@linux-foundation.org, james.morse@arm.com, bodeddub@amazon.com, david@redhat.com, catalin.marinas@arm.com, song.bao.hua@hisilicon.com Cc: kernel-team@android.com, Will Deacon , smuchun@gmail.com, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, fam.zheng@bytedance.com Subject: Re: [PATCH v2 RESEND 1/2] arm64: avoid flushing icache multiple times on contiguous HugeTLB Date: Mon, 7 Mar 2022 22:03:36 +0000 Message-Id: <164668935493.3276132.12110588269320094587.b4-ty@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220302084624.33340-1-songmuchun@bytedance.com> References: <20220302084624.33340-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2 Mar 2022 16:46:23 +0800, Muchun Song wrote: > When a contiguous HugeTLB page is mapped, set_pte_at() will be called > CONT_PTES/CONT_PMDS times. Therefore, __sync_icache_dcache() will > flush cache multiple times if the page is executable (to ensure > the I-D cache coherency). However, the first flushing cache already > covers subsequent cache flush operations. So only flusing cache > for the head page if it is a HugeTLB page to avoid redundant cache > flushing. In the next patch, it is also depends on this change > since the tail vmemmap pages of HugeTLB is mapped with read-only > meanning only head page struct can be modified. > > [...] Applied first patch only to arm64 (for-next/mm), thanks! [1/2] arm64: avoid flushing icache multiple times on contiguous HugeTLB https://git.kernel.org/arm64/c/cf5a501d985b Cheers, -- Will https://fixes.arm64.dev https://next.arm64.dev https://will.arm64.dev