From patchwork Fri Mar 3 19:58:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 13159445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1B588C7EE2F for ; Fri, 3 Mar 2023 20:00:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E3136B0073; Fri, 3 Mar 2023 15:00:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6466F6B0072; Fri, 3 Mar 2023 15:00:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 44B7A6B0074; Fri, 3 Mar 2023 15:00:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1F5026B0074 for ; Fri, 3 Mar 2023 15:00:39 -0500 (EST) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id ED5F9ABB93 for ; Fri, 3 Mar 2023 20:00:38 +0000 (UTC) X-FDA: 80528654556.29.1FD7DD5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id A23A9180016 for ; Fri, 3 Mar 2023 20:00:35 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eXp1RSew; spf=pass (imf16.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1677873637; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:references:dkim-signature; bh=FePX2+VFBr01iZwaVbBM1HjdLAtX/eNoAgkcl35m848=; b=weHbtOtsntT3h68TUmsV56PTG33gvmdtH9OQzG9fUc2T0maLD0e8Za6cmtJdFyMIA99q58 N/HDV7qIHJi17jy5fb1bU0s+9N0kF6I0WiDIbmvA1Te2vAny+TlnjVd4FEErB0ATlv1Qy2 G6rwSm9u0GOJl6CQqnnWYHmrlZH2f8s= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eXp1RSew; spf=pass (imf16.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=mtosatti@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1677873637; a=rsa-sha256; cv=none; b=aUTNg7uR669ckUFYl9qC2kQCJemicjav1V5lsWCLrsg0KyHrqEP0HxeUALbEhr84pk/DMK LPppo0SXdZqVm/CszPt4AQcbNqTJ+lGE9wTfo+sbVNWYEpfvxyR1wLLBvppdSxgGljfkP+ ARhJJU8tdp40xLDjI/lkgiVOGJCra5Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677873634; 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=eXp1RSewFRwJASXTUvECihX3+jtcnez3oP4z/ruEPFeB6gADtqcq9vFn+IKK/zk9j9J88K 166XBUWW5d8QXOq5jeTQyMt0dlIvNUZWIWbo0SidFCLql2NDF8Ct9QsLXIbfxJdqf1sjRZ xEjNYornbRJQVpecBjb8I/aeehgGlRw= 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-212-OPuKcFE6ON6wpaC72tuhoQ-1; Fri, 03 Mar 2023 15:00:33 -0500 X-MC-Unique: OPuKcFE6ON6wpaC72tuhoQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5A063185A7A4; Fri, 3 Mar 2023 20:00:32 +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 2D93D40CF8EF; Fri, 3 Mar 2023 20:00:32 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 94CB94291962D; Fri, 3 Mar 2023 17:00:12 -0300 (-03) Message-ID: <20230303195908.851997547@redhat.com> User-Agent: quilt/0.67 Date: Fri, 03 Mar 2023 16:58:45 -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, Marcelo Tosatti Subject: [PATCH v3 04/11] this_cpu_cmpxchg: S390: switch this_cpu_cmpxchg to locked, add _local function References: <20230303195841.310844446@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Rspam-User: X-Rspamd-Server: rspam03 X-Stat-Signature: id4pukm5t9fg6oxr11brwmehxbhr3ns8 X-Rspamd-Queue-Id: A23A9180016 X-HE-Tag: 1677873635-467687 X-HE-Meta: U2FsdGVkX192QMGgxiLDOpLThzvh1n/yEX8O8EUfBszpbMAK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yc0ceEXOztPePmDL/EiPLD6d8AnCucA7NmJqfc4+o17BPByfYCUT6i4vD32B6AGL2IVgO3qcy+R8a9UxnzvPo+OzQLApcm8x7mIH2vhMtK+0ldNDoYQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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__; \