From patchwork Tue Mar 14 18:59:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 69807 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1939902wrd; Tue, 14 Mar 2023 12:18:57 -0700 (PDT) X-Google-Smtp-Source: AK7set8+vm/AW+M3b7bMPLwSGzM5nqwAA/2pwI5RE8VGyu9fcgbPRKXWm1ytgsnmrmOxjqjEpi6F X-Received: by 2002:a17:90b:1d0f:b0:234:2485:6743 with SMTP id on15-20020a17090b1d0f00b0023424856743mr38871572pjb.3.1678821536998; Tue, 14 Mar 2023 12:18:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678821536; cv=none; d=google.com; s=arc-20160816; b=gC3AR8JO6aBXv6H3JINdZVVEvi07JUKMbn7vANETDu4JLCHtaQIBTW2AyrhObFXvgf 4wgeLsxZkhiNmSYWHtQsv8j9itoFbpFszCXyIcQrSGV2gt7N0mVRcCJbx/98w16L1Vtd NlF/MERFM1c4pwfAX+47dKYiNaQiiHZkbQVcguGJn5WMFeNuK2frYgBgt2VLy9fHUkp1 2KeuXOk3rjLG7ALMwgZGSaqq6ofQ/0wcMzeEa5JPiRuYhJt5D9/iQdj6zR2HLg7AmFUb 6V8X/P0loQlZ/u4hjFrXCQ4E7VMMoo7FVNS1xAVtAcS3AAg2+Y0r9YoBPANsH3px8bha putQ== 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=FePX2+VFBr01iZwaVbBM1HjdLAtX/eNoAgkcl35m848=; b=BDh8N3Uy7XB7vURi7szXTJPZCqqJKynAZSJj4x+GYzawWw5QZdm4qpLDyLqZ2ftmS7 bKGOtDpi1Gqg6JQnhhPGnFUqnL/SvSMyagYl0kVLa1wiXcuVnH1SVzquNuYe4RGXx1US g1WS3VeXmXqZ+wflszhNzBRUlAYL1eaggNd7twlTrj6XvHS4RS1JrU8MEEWXn/QUuEoF kNF1h+/TqkygfPRXknVFFewi1YhNQRXgqljd/M5SsnRaLKn+it1325W/ipqGtVwCOExI RtMbW5JLNi/sBz5+Lde7JwSk96KogcJGytxw+/078nqVbz47KYXbpsSeWFu60jgBXV4l rmwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=f8eQHD2j; 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 bw18-20020a17090af61200b0023af4ee47dasi2926708pjb.65.2023.03.14.12.18.40; Tue, 14 Mar 2023 12:18:56 -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=f8eQHD2j; 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 S229960AbjCNTBv (ORCPT + 99 others); Tue, 14 Mar 2023 15:01:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229480AbjCNTBu (ORCPT ); Tue, 14 Mar 2023 15:01:50 -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 CC1AD2117 for ; Tue, 14 Mar 2023 12:01:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678820469; 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=FePX2+VFBr01iZwaVbBM1HjdLAtX/eNoAgkcl35m848=; b=f8eQHD2jP15SkHpcdFFCGGRDnXWTh3p7Lgyrccc+r0zjQ3SEntr67xVAO9OJQCDukRrP0i 4D7jxgXZnz7+4Bllhb2XnIzcAzvAYYzLBRktd6JJoxXpQ/8IFvxECPvR+iRKCDdXrLpX0C JohM6qW97XIVjordXMmdoW89lEWjbLk= 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-167-cFasFrcQOX2aPTg-iv9Y4g-1; Tue, 14 Mar 2023 15:01:04 -0400 X-MC-Unique: cFasFrcQOX2aPTg-iv9Y4g-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 7B0181014708; Tue, 14 Mar 2023 19:01:03 +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 490C8400F52; Tue, 14 Mar 2023 19:01:03 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 5B14E4039C28D; Tue, 14 Mar 2023 16:00:44 -0300 (-03) Message-ID: <20230314185951.603655249@redhat.com> User-Agent: quilt/0.67 Date: Tue, 14 Mar 2023 15:59:17 -0300 From: Marcelo Tosatti To: Christoph Lameter Cc: Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Russell King , Huacai Chen , Heiko Carstens , x86@kernel.org, Vlastimil Babka , Michal Hocko , Marcelo Tosatti Subject: [PATCH v6 03/12] this_cpu_cmpxchg: S390: switch this_cpu_cmpxchg to locked, add _local function References: <20230314185914.836510860@redhat.com> MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760371971931009154?= X-GMAIL-MSGID: =?utf-8?q?1760371971931009154?= Goal is to have vmstat_shepherd to transfer from per-CPU counters to global counters remotely. For this, an atomic this_cpu_cmpxchg is necessary. Following the kernel convention for cmpxchg/cmpxchg_local, add S390's this_cpu_cmpxchg_local. Signed-off-by: Marcelo Tosatti Index: linux-vmstat-remote/arch/s390/include/asm/percpu.h =================================================================== --- linux-vmstat-remote.orig/arch/s390/include/asm/percpu.h +++ linux-vmstat-remote/arch/s390/include/asm/percpu.h @@ -148,6 +148,11 @@ #define this_cpu_cmpxchg_4(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) #define this_cpu_cmpxchg_8(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) +#define this_cpu_cmpxchg_local_1(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) +#define this_cpu_cmpxchg_local_2(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) +#define this_cpu_cmpxchg_local_4(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) +#define this_cpu_cmpxchg_local_8(pcp, oval, nval) arch_this_cpu_cmpxchg(pcp, oval, nval) + #define arch_this_cpu_xchg(pcp, nval) \ ({ \ typeof(pcp) *ptr__; \