Message ID | 20230314185951.678940741@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 v21csp1940857wrd; Tue, 14 Mar 2023 12:21:28 -0700 (PDT) X-Google-Smtp-Source: AK7set9OcIWpcqw9SDNdsHyPwGd6dqTNXDGux8P4N2zt3pTW3FDefbPwjwg2j8ukujh5/U3JoDgl X-Received: by 2002:a17:90b:1d12:b0:234:e3f:f53b with SMTP id on18-20020a17090b1d1200b002340e3ff53bmr39256473pjb.21.1678821688688; Tue, 14 Mar 2023 12:21:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678821688; cv=none; d=google.com; s=arc-20160816; b=xqqrXpF3agatedSYhqMvhdJmI8xuz2yyRHqO71GwWNFRO7PKWDfJtV0YSsHtR5sMUr jqmIC4BL+qP5qxoqqSmMhrtsFbbhUxLfFBQrAj097kLHFhdP8kWXBMXWG51sFPy42HeT wTSu3V3xuLKVIkTVslLbf1yfgypjHSeDTK29quUieL6TZxsaOm1m5Gnj/q7HryqM7LrK 3i6Z68CsYz7/5jiXkZQoluPYdET0jiJ+UQMbzBv8+QPenYX8nL1Vhl3fCZIepi2LhE2v Q+ZVQMP++dqzT3FEiv/iqo1/+qLzbu+CJ3mgW+E5amI1LxVFHXbdpO25Rz/GHwDo8Wc/ upRg== 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=GsJckdhBaIVL+p11gTEdAH9oXfAz6ECyByg6rjDghaIuT/ZYfdJfeIgT9rEpjGtN7y UV0DJs0qSj+d4znvfINU+1iSQ4mmKIcr6nsYSZjlEw2fSHQQUU9+jhZ3x6/MP29KCV4b WS6vnMGosaDVpL1EyePc+e34IVZ6IxA3znPDExDjBEMu5W8QjQHytOwS3+3W8zf7pANQ FQF5T78Ok5ci0Q11ANmSZ23PrqbXBMO4E0/rdIo3dW80Ok1NWViebUurqDT3pOa0/2Tb ptrKeOTPNONb46JnxeZmtWmk8e/eb/teOSCBD105UDaxt0TnXR9GQKnASDoFpGyVSZEr YMcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AMiVm1q7; 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 i19-20020a17090acf9300b002367f75aa40si2878899pju.150.2023.03.14.12.21.12; Tue, 14 Mar 2023 12:21:28 -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=AMiVm1q7; 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 S231350AbjCNTC3 (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Tue, 14 Mar 2023 15:02:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231197AbjCNTB7 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Mar 2023 15:01:59 -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 6477EEC6F for <linux-kernel@vger.kernel.org>; Tue, 14 Mar 2023 12:01:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678820473; 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=AMiVm1q731P0Dk5sNb0ibUxDC+5mRqVunEmedQLy11RHdScubCv6bTeYDQOWzfys4+Tj38 Rub4+TEWx/v9A5tQvNoRzm8TQ2TydDl8wPQ/wixaFh5dO1uF2A4ulKD1lIhmAK3FusS5gW 7C0zNMSaRniJPzrXmz8pEC8oQtgjKyc= 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-359-nFSnaC_BP_mQcwnztKYEjw-1; Tue, 14 Mar 2023 15:01:07 -0400 X-MC-Unique: nFSnaC_BP_mQcwnztKYEjw-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 05ED6101A55E; Tue, 14 Mar 2023 19:01:05 +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 C894B140E95F; Tue, 14 Mar 2023 19:01:04 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 67D854039C290; Tue, 14 Mar 2023 16:00:44 -0300 (-03) Message-ID: <20230314185951.678940741@redhat.com> User-Agent: quilt/0.67 Date: Tue, 14 Mar 2023 15:59:20 -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 v6 06/12] convert this_cpu_cmpxchg users to this_cpu_cmpxchg_local References: <20230314185914.836510860@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?1760372130741671418?= X-GMAIL-MSGID: =?utf-8?q?1760372130741671418?= |
Series |
fold per-CPU vmstats remotely
|
|
Commit Message
Marcelo Tosatti
March 14, 2023, 6:59 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);