From patchwork Mon Mar 20 18:03:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marcelo Tosatti X-Patchwork-Id: 13181693 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 6BC5DC7618A for ; Mon, 20 Mar 2023 18:12:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EEFA16B0083; Mon, 20 Mar 2023 14:12:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E50916B0087; Mon, 20 Mar 2023 14:12:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C55586B0088; Mon, 20 Mar 2023 14:12:14 -0400 (EDT) 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 8F5196B0083 for ; Mon, 20 Mar 2023 14:12:14 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 3622FC0D96 for ; Mon, 20 Mar 2023 18:12:14 +0000 (UTC) X-FDA: 80590070988.07.C7317AD Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf09.hostedemail.com (Postfix) with ESMTP id 738AF140024 for ; Mon, 20 Mar 2023 18:12:12 +0000 (UTC) Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bVllhTjK; spf=pass (imf09.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=1679335932; 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=ZYdI/NkwLfDGmXJs7KnOK9vem40tm0vaN9MiHTPCcnM=; b=QvkE4cFZMaIDwXIRthIm7Vq8m3WYI6vq/HGS3wcv+CWWnVHxS0n0tM0AuYDuR0HgWurF2u dg+hPZB8JZjEi5PQeOGgYtEyhMUCkFUCMYGQbiwajsomadoQl6mSc1jYUCP1X1XARqeoni D6tQOGMwpcMjj9shCMCV2U4NRDYzqes= ARC-Authentication-Results: i=1; imf09.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=bVllhTjK; spf=pass (imf09.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=1679335932; a=rsa-sha256; cv=none; b=ZR4um1BuPiwJRyosKk7TW/7MTdiyfxZYI2NNyUFRTlUG5ovVhAH5p7YYV5Ls82tOS1dwCq M5aIS4lN/LZSvznDSWdyq7oWcVL8aoRA/lnOWd7mjYnf3uV1LWnJ8TuWB8RTLTI+N7GN0A IqgXrs3e1xI/TDnZMZkT5/6GF4m91+M= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1679335931; 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=ZYdI/NkwLfDGmXJs7KnOK9vem40tm0vaN9MiHTPCcnM=; b=bVllhTjKFX6mvp0cM+qwus0uOcTolB2dd/eUBgF4A38ykFHcnFE1LCw0mTYxCuHMANpI4s k4GcRi7zI7YXUPmJuyufikA1JXPbdigZhsEgiLSoKNB4eU24jAZhwQLCYFRJytu40ksN1V dzv3fQGr9xg8IFr748+yCucMh4jRmCA= 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-138-7w4ECqAPP2uSVIr-cMmNMA-1; Mon, 20 Mar 2023 14:12:05 -0400 X-MC-Unique: 7w4ECqAPP2uSVIr-cMmNMA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 32B9B858289; Mon, 20 Mar 2023 18:12: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 062781121315; Mon, 20 Mar 2023 18:12:05 +0000 (UTC) Received: by tpad.localdomain (Postfix, from userid 1000) id DAF1E403BC8B1; Mon, 20 Mar 2023 15:08:02 -0300 (-03) Message-ID: <20230320180745.632709950@redhat.com> User-Agent: quilt/0.67 Date: Mon, 20 Mar 2023 15:03:36 -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 v7 04/13] this_cpu_cmpxchg: S390: switch this_cpu_cmpxchg to locked, add _local function References: <20230320180332.102837832@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Stat-Signature: whfa33oqzpybapujp11smmmzausqyxpw X-Rspam-User: X-Rspamd-Queue-Id: 738AF140024 X-Rspamd-Server: rspam06 X-HE-Tag: 1679335932-41106 X-HE-Meta: U2FsdGVkX1/0zeDQXXvihwCJf8w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q8wr52pu2NGZZjA4Wq5QH2qjeI4Ojqbmc4YwpHSy8aN5S4HIQnsEzR7fLNWeNc2r9RWGEYMitdzZlZnoc3YfRZL2QsGw5rNCZtd3kNGfskkxSvBKcRo5KwdMQqLSeHNA== 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__; \