Message ID | 20230313162634.408562151@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 v21csp1286974wrd; Mon, 13 Mar 2023 09:40:25 -0700 (PDT) X-Google-Smtp-Source: AK7set+HxK6AES84qLJ0oeXiDBuzOhyH7EyR0DWq7xZiQxfIYHtbnLd0AR8yy6EA4OhEQL9qWqOz X-Received: by 2002:aa7:951a:0:b0:625:29b8:372e with SMTP id b26-20020aa7951a000000b0062529b8372emr1601575pfp.29.1678725624985; Mon, 13 Mar 2023 09:40:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678725624; cv=none; d=google.com; s=arc-20160816; b=oXPRYufuiMom65RZYniPEPSXwOtMNMwk99aJSkharTW9c9p9q9qwRYCUgGYUNgwb94 PhpeJSpkL+dXdA+9W/rNDjqdYC+yx/oeYRQpD3ydyeStvVsoPNC3n5cEQDVlMlQ6ALdR s/pa6X7mFvah2sjTp+RxfBdjUyhgIahpXkoCJaatVBQe0H6CER4xDgJLEa33krhvcy7h xApStbV0THPenTI2CaYR5GtYGcbcaENaikBxgjbNddMwdoan3cJkaNANNd5T7RUgEwx6 0mpH9t8QJ3RjAakgJzmE7F5usBqM5e3HC/FZAyje9qROVAIx7Bal9FyrLu/x/qtxHaUf 3kvw== 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=WXJ2l6cWIblOqj9+k9/gMHVSByh5iZo0R+3RRVZpWz/SoCD6MT2SZ+Qtj2MU2B3QVn YYt5XfvVQusolYmv0/s6Xv4/622SVI2neB4t5EMKoMbM5WhVn6gWg6LitvpUKLFbs7oH NBvJe4jPFUDcFzIeZVt/ao7wtL4EqafZ30BQm2zMRVQd+SL4zyJ7RzmxI9vCNko0HPVC yhYMuTSu3XxptSEwwYsCSx5B5VohYszXMKH+BdGXUkcy33569TKT1/qawUjWkn7GJKdY ZAW3OvDOnkD7VoBKlo6znCR0ZI5n48UTGmNMhNuBgwroa8w/tTFMQZpKP4Ji1z/sTQ3F nxHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PbXlg6ir; 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 x12-20020aa78f0c000000b005925d784cc8si6717931pfr.343.2023.03.13.09.40.10; Mon, 13 Mar 2023 09:40:24 -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=PbXlg6ir; 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 S229968AbjCMQ3x (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Mon, 13 Mar 2023 12:29:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50350 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231337AbjCMQ3F (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Mar 2023 12:29:05 -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 79F246EB8F for <linux-kernel@vger.kernel.org>; Mon, 13 Mar 2023 09:27:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678724868; 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=PbXlg6ir4OWV1cz3Tz/eRdC8nYfB/f6KpO08DYpRjYTLmeZUaWxMO8/X5DbByjYvq2fvP1 cqZMdMqZBy5btIlzqq8CwKI9zn5mWaKa9Wk96GJgkPioPQ6T7bXkqd298iPlLjzh/IT90p 8xLbEp5FaGuopQ9dWD/l7fk0+K7Sm9Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-33-kVC4bivEN-u7qO5pSUEO8w-1; Mon, 13 Mar 2023 12:27:43 -0400 X-MC-Unique: kVC4bivEN-u7qO5pSUEO8w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 322263C0D1AE; Mon, 13 Mar 2023 16:27:42 +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 F07B23542A; Mon, 13 Mar 2023 16:27:41 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 25FC74038A1F2; Mon, 13 Mar 2023 13:26:44 -0300 (-03) Message-ID: <20230313162634.408562151@redhat.com> User-Agent: quilt/0.67 Date: Mon, 13 Mar 2023 13:25:13 -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>, Peter Xu <peterx@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com> Subject: [PATCH v5 06/12] convert this_cpu_cmpxchg users to this_cpu_cmpxchg_local References: <20230313162507.032200398@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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?1760271401023488999?= X-GMAIL-MSGID: =?utf-8?q?1760271401023488999?= |
Series |
fold per-CPU vmstats remotely
|
|
Commit Message
Marcelo Tosatti
March 13, 2023, 4:25 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);