Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1482429lqh; Mon, 6 May 2024 08:57:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWfsiGuxcFNjS9RGQQY8ufSjWQbkPVc2Z5oSBjtiBVV2fkGc/74+9GCb14wXUDV1i1tgaWn2Q8qJzmft9o+e0HD6xwPjK+gByqdIUl/KQ== X-Google-Smtp-Source: AGHT+IE1Yj/BZ1rq0up572q3HwlWftC9EcZPojffgsiJfsQfdnjeoeH7bP9yjsi8Zd+XUI2n6RYG X-Received: by 2002:a50:ab1a:0:b0:56e:2b80:d87e with SMTP id s26-20020a50ab1a000000b0056e2b80d87emr9596215edc.2.1715011071730; Mon, 06 May 2024 08:57:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715011071; cv=pass; d=google.com; s=arc-20160816; b=r4SsWYbZ1LuQqCB7+elaRY+etDJ9E023A0Jbbph9MC8HBHjlt9bi+UUd7OcpiWkutQ lKf8hB7PnKns7jt9MvdK0HqKgu7FYUpHCVeD+9Dl6bD7ZtUuKJw3KgRMZgm3Mm8Pczfz uk5997O7+TIBD+P6I9eT/C5gtNtoiLBNShb3wOVDDWx7Q07ggPZsfvbUNKSwDifdf4kn OwqWkBRF5ZmTpatTfbNuPY2KltNO6ZRMJzCEalQ5uLEOVgq69qiGavE7qpjXVO+D6G3Q j++zCNlUMFfne6w7MFFs1GiwJfu9yJR15P+oC0mYWIk7n0eSwlMdTqBTJJvKKbbhCbCQ 2MEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=j6/KtEs6TFeoK8UWIq9uFemS/8A9ve6yI0uusmjA3lY=; fh=ZaPvTvk3greVAhtlw/faBL7y/bcze5JBULOYO1tsevI=; b=rrt7omTls1f74B2T4JRqTgwh6kWI2gwPs9sTVaC6RLHImMhebByG7Z0el0oSALORGI Qn0BuGuewzUU8+fqBpX4kGv/mrm+8pLDxVOxPRodgNMzDKTVBrsOIZzvyAGU3teOmt4m f/A1n45iQ/z+1gh4MlCy6zuEmxauKYNhcN1pOsQo0AprVlduNtkTGEOqmfGAJNNFjjHL D6DYKQF6kQS1c+0dNxBfxp7sn5u1PU6FwKCi+82F3HUBrR6OyIQ6v9jYG5CEOVPA/YTZ 5bTMCh941Y8zoQb1xImfCpstM9hmuSuTvfdTlGW67Tg7IZ8AjfVl69n4BgIjq8U/R9gD N6Mg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=oV1gmpqq; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-170106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id n17-20020a056402515100b00572aedd0fc1si4850433edd.659.2024.05.06.08.57.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 08:57:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=oV1gmpqq; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-170106-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170106-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 191101F2437D for ; Mon, 6 May 2024 15:57:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E9EEB15573E; Mon, 6 May 2024 15:57:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="oV1gmpqq" Received: from out0-210.mail.aliyun.com (out0-210.mail.aliyun.com [140.205.0.210]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6569C4D58E for ; Mon, 6 May 2024 15:57:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=140.205.0.210 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715011043; cv=none; b=MskOrd5VFtVnCUTFBIupnCh9YBPIrqfovHUgDWBo+YUTdSWIhQ1op5RQ2A89eVzzz12h0VabaV+S23GtCzkp9iK7oJC/5Hn46Q/N4wE/4vB7tQi7NlQAUg/jPoFCvWl/XcxtIlC1a9e1tyeqJW4SzQn15BJVOQk4xx2dOckXgeM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715011043; c=relaxed/simple; bh=QxU4xP/UtRSyvVOvavTzU56iJmtUuco9rYcv/ovt128=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Cmm3mgeWd5a/hdXrsEl3frPndBEEB+C/FlDZCUqflr3fAes4B54xGeMgklMFk+c5P3+m3lMXspUy2taa0SiYCpCIQM/eSXg+ehYVgEfrkbzsw0sVFyJFFnC7zxJxDq2OhK5U27qUUjicTwoLcQa1N+F1arO6CMqZKTC7qye0HoI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=oV1gmpqq; arc=none smtp.client-ip=140.205.0.210 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1715011038; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=j6/KtEs6TFeoK8UWIq9uFemS/8A9ve6yI0uusmjA3lY=; b=oV1gmpqqAuX/9T8PND1UwE3ZtDrlbZJfoieJ+hdijrzn4M2h5IgPz8V4TeWSr6U0SCYY9r3zDAx5kOB9wRfCw58XVgQYys8vrvU0NVKwtSb6esMYilwkA7pBEgwrLIrkXoFIR1jXNgVgHc0o4z37kqDhYQtEWyG3eK2smsrb23I= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R581e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047204;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.XThas7i_1715010719; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XThas7i_1715010719) by smtp.aliyun-inc.com; Mon, 06 May 2024 23:52:00 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , "Bang Li" Subject: [PATCH v2 0/5] Add update_mmu_tlb_range() to simplify code Date: Mon, 06 May 2024 23:51:15 +0800 Message-Id: <20240506155120.83105-1-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series of commits mainly adds the update_mmu_tlb_range() to batch update tlb in an address range. After the commit 19eaf44954df ("mm: thp: support allocation of anonymous multi-size THP"), We may need to batch update tlb of a certain address range by calling update_mmu_tlb() in a loop. Using the update_mmu_tlb_range(), we can simplify the code and possibly reduce the execution of some unnecessary code in some architectures. Thanks, Bang Changes since v1 [1]: - Add __HAVE_ARCH_UPDATE_MMU_TLB_RANGE macro (per Lance Yang) [1] https://lore.kernel.org/linux-mm/20240429103346.59115-1-libang.li@antgroup.com/ Bang Li (5): LoongArch: Add update_mmu_tlb_range() mips: Add update_mmu_tlb_range() riscv: Add update_mmu_tlb_range() xtensa: Add update_mmu_tlb_range() mm: Add update_mmu_tlb_range() arch/loongarch/include/asm/pgtable.h | 4 ++++ arch/mips/include/asm/pgtable.h | 4 ++++ arch/riscv/include/asm/pgtable.h | 4 ++++ arch/xtensa/include/asm/pgtable.h | 4 ++++ arch/xtensa/mm/tlb.c | 6 ++++++ include/linux/pgtable.h | 8 ++++++++ mm/memory.c | 4 +--- 7 files changed, 31 insertions(+), 3 deletions(-) -- 2.19.1.6.gb485710b