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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 41C76C4167E for ; Fri, 11 Nov 2022 10:17:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id BCFC96B0071; Fri, 11 Nov 2022 05:17:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B58EB8E0001; Fri, 11 Nov 2022 05:17:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9F9C36B0074; Fri, 11 Nov 2022 05:17:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 8E2CB6B0071 for ; Fri, 11 Nov 2022 05:17:14 -0500 (EST) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 5FA7F1C5DDA for ; Fri, 11 Nov 2022 10:17:14 +0000 (UTC) X-FDA: 80120758788.04.A3022A4 Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by imf21.hostedemail.com (Postfix) with ESMTP id C2A711C0004 for ; Fri, 11 Nov 2022 10:17:12 +0000 (UTC) Received: by mail-wr1-f53.google.com with SMTP id g12so5840867wrs.10 for ; Fri, 11 Nov 2022 02:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=BH/APi1a0PoKAJZknP8AkAonpu9TnXBBnNUq+HUkcwM=; b=4oOscMH7jU6ury8coe6FqLy7zK1XZNinWBvFR7izLUhT8UO+Uf7A34vnnALOX+0uZw 6u0BzpFG7Xf65rlpJuAvjMgTNhVx/gSKcxgRlSDN2zH7W+6LI6BnNcuT8FnlleBan74e U+nnWKJgynFDrs5h1v4LHjxM1v+N8pvPWTcuhFJiAYBmZcFqEaaRiyqBxAjt+VLKVj27 ymKqo1xHrZ7qEJ3SsTyk8ixNapD9K4j74hbbeGy2nwxMGfxLNJInz1YB3DFYiKEqav4a oeGBzhxJPbF4jd3XpyzDJKvMeI1dC4S63nsd7WzmmwS7/SrtVuS1+i59tvEjxRd8GW0+ CSgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BH/APi1a0PoKAJZknP8AkAonpu9TnXBBnNUq+HUkcwM=; b=D/Bvfh0QsO62yZqh8oMvyMy0/HRoPvoGMSzZT5DUnrP03BCsV/H47zyJqeHc2hvKwa NRnD/YpzGu0l3uwaQHvhgZ3QwJJ+bcijwS9mykhcDjR0MaaYuqSufCdyDQlqNu+MlVbG zaS935EhuLQoDk2QmTSb3LfN7zpAymzOHBdjTGayr47/Veu2ONhqtbkEI69YalBRyva+ oemStZxpEjyZj2MEN2P1ROTnQMu4TQl4HRDcv8cdVQMivL0xv1+YieH6s/4QW3F1z7nD pML5Lg/+smjxEcUxGlDs/BoqOglPnICjwtu/Ud3n3DdebzCH2d5QCCAu1fsThFSQzm4B ecdg== X-Gm-Message-State: ANoB5pkgns1upfbhfaM5Zlr/IwgJUFbfhTRDOpjM4+uWOKD5PRWqmE5c l7Dv6a7t52KMjKFVnzZPGRi99A== X-Google-Smtp-Source: AA0mqf4pSdxpuNsvbAiQ/VPT4Uicb2yIOEyOj0DptBJEnqY46AvxjvE1jv4RoOcak7HL0HGEg3fM1Q== X-Received: by 2002:a05:6000:18cc:b0:236:6d79:b312 with SMTP id w12-20020a05600018cc00b002366d79b312mr805921wrq.699.1668161831083; Fri, 11 Nov 2022 02:17:11 -0800 (PST) Received: from localhost ([95.148.15.66]) by smtp.gmail.com with ESMTPSA id h8-20020a05600c2ca800b003b4a699ce8esm8500043wmc.6.2022.11.11.02.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 02:17:10 -0800 (PST) From: Punit Agrawal To: Yicong Yang Cc: , , , , , , , , , , , , , , , , , , , , , , , , , Barry Song <21cnbao@gmail.com>, , , Subject: Re: [External] [PATCH v5 0/2] arm64: support batched/deferred tlb shootdown during page reclamation References: <20221028081255.19157-1-yangyicong@huawei.com> Date: Fri, 11 Nov 2022 10:17:09 +0000 In-Reply-To: <20221028081255.19157-1-yangyicong@huawei.com> (Yicong Yang's message of "Fri, 28 Oct 2022 16:12:53 +0800") Message-ID: <87pmdtztga.fsf@stealth> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=4oOscMH7; spf=pass (imf21.hostedemail.com: domain of punit.agrawal@bytedance.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=punit.agrawal@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668161834; a=rsa-sha256; cv=none; b=QNU59DlEPHzRytQeQGfYs3/yus6VAMryiNALmyIf8+sYFjgBVUfR8nFonl4dHr3HdWa4EH ZvcYsBSpZ0HEmdtSfkoT1dKFxdA3SMSr30lb6d+trhqhDRAc/nkbtiWGbc7OjrXm9TSlvm js5+Oeel/xdW9K+2qLU3kYcPN+ACV/c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668161834; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=BH/APi1a0PoKAJZknP8AkAonpu9TnXBBnNUq+HUkcwM=; b=5D9ZpQGaLmlnRB7N8/UWuDVRQVvm/oQI6bCy4JUKA7kMx/JtiX0EF2eE2Toags8meOH4Kj 1XqczXuSeZlDXeiXsChHg7K0T3H6hfpNTRy4+9ROZwJyTgaYUYeGUG8OijA2r710tMonpI m1bEiRuzWFwxyKFLhWPAbkaLGWratXc= X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: C2A711C0004 X-Rspam-User: Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=4oOscMH7; spf=pass (imf21.hostedemail.com: domain of punit.agrawal@bytedance.com designates 209.85.221.53 as permitted sender) smtp.mailfrom=punit.agrawal@bytedance.com; dmarc=pass (policy=none) header.from=bytedance.com X-Stat-Signature: a9fefr1ucs44g1kkxrntpooo7bhs9ha5 X-HE-Tag: 1668161832-197451 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: Yicong Yang writes: > From: Yicong Yang > > Though ARM64 has the hardware to do tlb shootdown, the hardware > broadcasting is not free. > A simplest micro benchmark shows even on snapdragon 888 with only > 8 cores, the overhead for ptep_clear_flush is huge even for paging > out one page mapped by only one process: > 5.36% a.out [kernel.kallsyms] [k] ptep_clear_flush > > While pages are mapped by multiple processes or HW has more CPUs, > the cost should become even higher due to the bad scalability of > tlb shootdown. > > The same benchmark can result in 16.99% CPU consumption on ARM64 > server with around 100 cores according to Yicong's test on patch > 4/4. > > This patchset leverages the existing BATCHED_UNMAP_TLB_FLUSH by > 1. only send tlbi instructions in the first stage - > arch_tlbbatch_add_mm() > 2. wait for the completion of tlbi by dsb while doing tlbbatch > sync in arch_tlbbatch_flush() > Testing on snapdragon shows the overhead of ptep_clear_flush > is removed by the patchset. The micro benchmark becomes 5% faster > even for one page mapped by single process on snapdragon 888. > > With this support we're possible to do more optimization for memory > reclamation and migration[*]. I applied the patches on v6.1-rc4 and was able to see the drop in ptep_clear_flush() in the perf report when running the test program from Patch 2. The tests were done on a rk3399 based system with benefits visible when running the tests on either of the clusters. So, for the series, Tested-by: Punit Agrawal Thanks, Punit [...]