Message ID | 20230305134053.587741722@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1378213wrd; Sun, 5 Mar 2023 05:47:50 -0800 (PST) X-Google-Smtp-Source: AK7set88HYsikaa2zRfr6fblvIMPd/8zehUQ41THuWmDX3lgO6rhgL2j5pOnFViyyqfrtBcl3fD3 X-Received: by 2002:a17:902:f689:b0:198:f8c9:7f4b with SMTP id l9-20020a170902f68900b00198f8c97f4bmr12470813plg.2.1678024070445; Sun, 05 Mar 2023 05:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678024070; cv=none; d=google.com; s=arc-20160816; b=mjnl0tuhGM/yD+hT1joEXn1/2wEvV0jJ7GttuW1tsI14MbwWOOTaL/bHr9wiadYIrV +25cPEsfIX5QiY+BHyGDLr3O9RXiwsptzQKjP0Vqkv9o2M34C9mNAHIylRXzTebmrcm1 lDGtMvpGRAGxutw0Cy1ogBPxtLx4dnUvoP8vf2uqNufbXjyIX6FqGdu7dYHu3yQSCL8v vgwT8B9+pKsdgPIDA8z/XT8EtSRFDtLJ5NnFGIy3O3AnIiG5S0pX4kqiYJaLAd5xJZuy HcqFpBwUlhgIvokfW5VriMQpESzE1gKMFllrERtAWb76ccbi0Aqw/qfnosxvygJz1mef DdaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:subject:cc:to:from:date :user-agent:message-id:dkim-signature; bh=4jas7+kZOWWtovsxw7rARjyOL6nO08FiGsNhXOwYk0U=; b=HzUEhdeXX8odeWXw4IE/Lgc8NLGeKdWclsPo+zSLL3sRXCTJOhitLHktiMkqbEsLXs OFtu/YaaIzPX5iq2PUoWOrGXxpleCxXEQ4pZAVOr3kCw/0dZesQAX/BUDx6/qYOFjS9M YfIxlcILCoONbuOgcguq8ARycUujlGJiT7d+gPizFdckF168PaJHlb3ZbnUQjQ4TCNU0 g+8WvMhBYdk9wnccnQWxdMYtBbWO6IHEtT5IoGqGxnL4izxPvB/RQOkF6Dlm96xUGHJ8 y+Tpbbv2wfUYP/kAxS1s83L4Ig4RP+fJy1iiWz8vbB+XI/N1OvPCUGf/JdDAgZmwOr7M TDaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dJ4oCxam; 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=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i184-20020a6387c1000000b00502ea97a70csi7015604pge.837.2023.03.05.05.47.37; Sun, 05 Mar 2023 05:47:50 -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=@redhat.com header.s=mimecast20190719 header.b=dJ4oCxam; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229891AbjCENnd (ORCPT <rfc822;carlos.wei.hk@gmail.com> + 99 others); Sun, 5 Mar 2023 08:43:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54036 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229824AbjCENnV (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 5 Mar 2023 08:43:21 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 576CE1353C for <linux-kernel@vger.kernel.org>; Sun, 5 Mar 2023 05:41:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678023708; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=4jas7+kZOWWtovsxw7rARjyOL6nO08FiGsNhXOwYk0U=; b=dJ4oCxamnSSAJS5qySE2URIZktV88L3KwJ2Z5EL8F9hQDGAa7JeN7syCktRTRXqN/04AWq RT0j+jrQZQcK5/asdvRXWPHN7g67uBN/VAVCh0QiI1gSFta5lDeD1WFUTlL860t8R8mViM gdaXPs2SLLZOANXV4cdj3gzZZrSlhBg= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-8iJu-gaUM3O6uf58ubxlWA-1; Sun, 05 Mar 2023 08:41:45 -0500 X-MC-Unique: 8iJu-gaUM3O6uf58ubxlWA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id D9AD7101A52E; Sun, 5 Mar 2023 13:41:44 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-2.gru2.redhat.com [10.97.112.2]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A647D14171C3; Sun, 5 Mar 2023 13:41:44 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 2F3B7401A0FEE; Sun, 5 Mar 2023 10:41:23 -0300 (-03) Message-ID: <20230305134053.587741722@redhat.com> User-Agent: quilt/0.67 Date: Sun, 05 Mar 2023 10:37:04 -0300 From: Marcelo Tosatti <mtosatti@redhat.com> To: Christoph Lameter <cl@linux.com> Cc: Aaron Tomlin <atomlin@atomlin.com>, Frederic Weisbecker <frederic@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King <linux@armlinux.org.uk>, Huacai Chen <chenhuacai@kernel.org>, Heiko Carstens <hca@linux.ibm.com>, x86@kernel.org, Peter Xu <peterx@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com> Subject: [PATCH v4 07/12] convert this_cpu_cmpxchg users to this_cpu_cmpxchg_local References: <20230305133657.255737580@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759535767530230519?= X-GMAIL-MSGID: =?utf-8?q?1759535767530230519?= |
Series |
fold per-CPU vmstats remotely
|
|
Commit Message
Marcelo Tosatti
March 5, 2023, 1:37 p.m. UTC
this_cpu_cmpxchg was modified to atomic version, which can be more costly than non-atomic version. Switch users of this_cpu_cmpxchg to this_cpu_cmpxchg_local (which preserves pre-non-atomic this_cpu_cmpxchg behaviour). Acked-by: Peter Xu <peterx@redhat.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Index: linux-vmstat-remote/kernel/fork.c =================================================================== --- linux-vmstat-remote.orig/kernel/fork.c +++ linux-vmstat-remote/kernel/fork.c @@ -203,7 +203,7 @@ static bool try_release_thread_stack_to_ unsigned int i; for (i = 0; i < NR_CACHED_STACKS; i++) { - if (this_cpu_cmpxchg(cached_stacks[i], NULL, vm) != NULL) + if (this_cpu_cmpxchg_local(cached_stacks[i], NULL, vm) != NULL) continue; return true; } Index: linux-vmstat-remote/kernel/scs.c =================================================================== --- linux-vmstat-remote.orig/kernel/scs.c +++ linux-vmstat-remote/kernel/scs.c @@ -83,7 +83,7 @@ void scs_free(void *s) */ for (i = 0; i < NR_CACHED_SCS; i++) - if (this_cpu_cmpxchg(scs_cache[i], 0, s) == NULL) + if (this_cpu_cmpxchg_local(scs_cache[i], 0, s) == NULL) return; kasan_unpoison_vmalloc(s, SCS_SIZE, KASAN_VMALLOC_PROT_NORMAL);