Message ID | 20230320180745.709381791@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1374532wrt; Mon, 20 Mar 2023 11:42:00 -0700 (PDT) X-Google-Smtp-Source: AK7set8KeEPLCrETHB7/CK1GmbU4nb+JhY5Iq/o6D/vxnzzh7ybgfbdkSU5uLTMq9V1ZpElFbABB X-Received: by 2002:a17:903:124d:b0:19e:7a2c:78a7 with SMTP id u13-20020a170903124d00b0019e7a2c78a7mr21944423plh.57.1679337719796; Mon, 20 Mar 2023 11:41:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679337719; cv=none; d=google.com; s=arc-20160816; b=KJ6MMHNIjzbSCTy21SVnHkgD9B/JAggeXk6NDnqG936TxArkTx80H/hqq5+dc37vzv jhgBLjeIiqwmDeL419szt6s7mZChwcp1dRxnO5cHxjxSJyLtjF/ldayWEMX0lFEQf9o+ QvrbHJI1KHj6Wqi5+1QPYj2BVF5gYdcu+/3ftRMiuY1ivx9Y0NtSFqVlNBoJvDUADRT4 8l7O4FWgruCutGhBmO8fnXuJwGR0CLEifw8XjTzLNyegFFHe+dPbkrbSqHfk24BzUIOs 9Hxbv6bP5tkNVi7IAm5YZg2QzbAJPaCtipqAGc9hxDNingC3mCIs/4Cxw7Bo3MqlwToR CXUg== 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=wO6Kd7Y8EK9tLPzGQ8Uve+plh0sOV79AJsB8xhd25oc=; b=q1G8zVSWiLqlJzHgcNZ7zFShOGAk2Y2A72P0k9bDNHfgtMImEgq5UvDoprmdsAkEVc XxI5xvyYj2SpvxeE82t337tBJRP04QFNNuBz6vjDM1Of1KxujGwJS0CbK2gKgG7DKk64 huvzirhaUJiecpEwUlGaxhpQMcAwZ0+xCMJ8pEX0rHYIWzrNJqBJmsrh2IBfFznD+Dkv mkEgmD9UYFYSII2jufabydk8T10nih1TOm+PptS55LOGMWbbVUCaPGj30Iot8lvhZX93 d0D/KmqwRuB8OWZfsNPb+1hSPHM0Od437yv1um1O+J5JwmcWuFkSduTqucf/Xjk9AarY 5XtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N9Sxo7Kt; 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 b10-20020a170902b60a00b001a1a1023808si1642458pls.603.2023.03.20.11.41.45; Mon, 20 Mar 2023 11:41:59 -0700 (PDT) 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=N9Sxo7Kt; 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 S230367AbjCTSUl (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 14:20:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59198 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231331AbjCTSUA (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 14:20:00 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7DCA642BCC for <linux-kernel@vger.kernel.org>; Mon, 20 Mar 2023 11:12:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679335933; 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=wO6Kd7Y8EK9tLPzGQ8Uve+plh0sOV79AJsB8xhd25oc=; b=N9Sxo7Ktzi6JhjMp5AnHWqaYNm68yAgDc5dlZCsgokjfY//z2iPIaIiAmxtybCf5GQVvNk 2ngDzrVHZmgfTDgziMliXh60HZrWynrOVxjqSNxRB0Dykcllb0kC7XID1E5cuqhB1/gKkH UUlamMKSEp6D6DdGghY4Q06j//32wdQ= 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-437-tjxg_1SWOlK-KVT9IU19TA-1; Mon, 20 Mar 2023 14:12:09 -0400 X-MC-Unique: tjxg_1SWOlK-KVT9IU19TA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 814FC100DEAD; Mon, 20 Mar 2023 18:12:08 +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 A6E57483EC4; Mon, 20 Mar 2023 18:12:07 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id E93FF403BC8B7; Mon, 20 Mar 2023 15:08:02 -0300 (-03) Message-ID: <20230320180745.709381791@redhat.com> User-Agent: quilt/0.67 Date: Mon, 20 Mar 2023 15:03:39 -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, Vlastimil Babka <vbabka@suse.cz>, Michal Hocko <mhocko@suse.com>, Peter Xu <peterx@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com> Subject: [PATCH v7 07/13] convert this_cpu_cmpxchg users to this_cpu_cmpxchg_local References: <20230320180332.102837832@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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?1760913228871839919?= X-GMAIL-MSGID: =?utf-8?q?1760913228871839919?= |
Series |
fold per-CPU vmstats remotely
|
|
Commit Message
Marcelo Tosatti
March 20, 2023, 6:03 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);