From patchwork Thu Feb 9 15:01:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 13134760 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 C73E7C636D7 for ; Thu, 9 Feb 2023 15:33:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2C0906B0081; Thu, 9 Feb 2023 10:33:26 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 26FB56B0085; Thu, 9 Feb 2023 10:33:26 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 05DEA6B0083; Thu, 9 Feb 2023 10:33:25 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 9B1916B0085 for ; Thu, 9 Feb 2023 10:33:25 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 4226EA0F5F for ; Thu, 9 Feb 2023 15:33:25 +0000 (UTC) X-FDA: 80448147570.07.EF4E6FD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf07.hostedemail.com (Postfix) with ESMTP id 687EC4000F for ; Thu, 9 Feb 2023 15:33:23 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ci8qSlE6; spf=pass (imf07.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1675956803; 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=spFyYZ23wqS6MC1RxdeQC9sXRSuPtqG2yfAIa15tCgeQ8zh+78rpKg8cOkGnrQXy9jCqDh cotwb+iFCagO0iwKi/cELdF7RYvwLDxsagmo+GMk2rYE8HAl29QVRPWdZ6R6zUDy3gxx7g C1WjNMQurR0uueAd9uAWFRXmC5BRBIk= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=ci8qSlE6; spf=pass (imf07.hostedemail.com: domain of mtosatti@redhat.com designates 170.10.129.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=1675956803; a=rsa-sha256; cv=none; b=iA6/jq4BYlgyWOY6CWcNr523W25kpawjbW8CzcBJmss3oI5MU5FKOuJu47QpeRlVbw/4O5 zeLKmywZ8XhZRKxKKFztvhBq17Y1xbD7nafs1ApAc3D3MElInvlKHmLZxBQ3eJ7VgoC4tL 4/t/8XNwRH+IdRqhlcCj7nGHAuS8zG8= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675956802; 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=ci8qSlE6n6XYlekD8zeuGNIyqMOP6qWUY75bEb9oYsrAR5PQG6eQrNdyGoulBabFLvcPhm tb58E7PALBvOpzd9+d2MlJhdRv/pef+IQKgYcOsyv8UfRBsV/L/ckpmNIO9aRPHQSy9IKs 9Fks4Ldrf6euzWZArrTytXF2xe5HpiQ= 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-467-f84dd5UROTGCJx2buXnEzg-1; Thu, 09 Feb 2023 10:33:20 -0500 X-MC-Unique: f84dd5UROTGCJx2buXnEzg-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CFC68104F0D0; Thu, 9 Feb 2023 15:33:14 +0000 (UTC) Received: from tpad.localdomain (ovpn-112-3.gru2.redhat.com [10.97.112.3]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A28292026D76; Thu, 9 Feb 2023 15:33:14 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id 6F68A403CC073; Thu, 9 Feb 2023 12:32:51 -0300 (-03) Message-ID: <20230209153204.737772842@redhat.com> User-Agent: quilt/0.67 Date: Thu, 09 Feb 2023 12:01:54 -0300 From: Marcelo Tosatti To: Christoph Lameter Cc: Aaron Tomlin , Frederic Weisbecker , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Marcelo Tosatti Subject: [PATCH v2 04/11] this_cpu_cmpxchg: S390: switch this_cpu_cmpxchg to locked, add _local function References: <20230209150150.380060673@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 687EC4000F X-Rspam-User: X-Stat-Signature: 7s3qffh9yh1sj9hindngnynz7yejnehf X-HE-Tag: 1675956803-181889 X-HE-Meta: U2FsdGVkX1+tDhJqCs8PvPJBGx9hXw9BsyWZm1UiPTYHpZcKkhQ4LWtRw0eXh5gTCWlWH0V1ECYVMh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K0U0xJ4poRj6m8ipC9hjS9HsSHfPck/6eAtdB2ba25NMx8ThQE5/ip3NZ3ooYijotfcUV3PncJQs94fvg== 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__; \