From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2938EC433E1 for ; Tue, 19 May 2020 21:46:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E8BE020657 for ; Tue, 19 May 2020 21:46:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E8BE020657 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=hisilicon.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 755368001B; Tue, 19 May 2020 17:46:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7055B900003; Tue, 19 May 2020 17:46:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 61AB58001B; Tue, 19 May 2020 17:46:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0236.hostedemail.com [216.40.44.236]) by kanga.kvack.org (Postfix) with ESMTP id 4A765900003 for ; Tue, 19 May 2020 17:46:20 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id F3BC4181AEF21 for ; Tue, 19 May 2020 21:46:19 +0000 (UTC) X-FDA: 76834802520.12.kitty24_7168edbe31d05 X-HE-Tag: kitty24_7168edbe31d05 X-Filterd-Recvd-Size: 3556 Received: from huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Tue, 19 May 2020 21:46:19 +0000 (UTC) Received: from dggemi403-hub.china.huawei.com (unknown [172.30.72.54]) by Forcepoint Email with ESMTP id A1673E410988D330014D; Wed, 20 May 2020 05:46:15 +0800 (CST) Received: from DGGEMI525-MBS.china.huawei.com ([169.254.6.191]) by dggemi403-hub.china.huawei.com ([10.3.17.136]) with mapi id 14.03.0487.000; Wed, 20 May 2020 05:46:08 +0800 From: Song Bao Hua To: Sebastian Andrzej Siewior , "linux-kernel@vger.kernel.org" CC: Peter Zijlstra , Ingo Molnar , Steven Rostedt , Will Deacon , "Thomas Gleixner" , "Paul E . McKenney" , Linus Torvalds , "Luis Claudio R. Goncalves" , Seth Jennings , Dan Streetman , Vitaly Wool , Andrew Morton , "linux-mm@kvack.org" , Linuxarm Subject: RE: [PATCH 8/8] mm/zswap: Use local lock to protect per-CPU data Thread-Topic: [PATCH 8/8] mm/zswap: Use local lock to protect per-CPU data Thread-Index: AQHWLhsB19zOKbhSok+Mjvon7Zb2Y6iv78fA Date: Tue, 19 May 2020 21:46:06 +0000 Message-ID: References: <20200519201912.1564477-1-bigeasy@linutronix.de> <20200519201912.1564477-9-bigeasy@linutronix.de> In-Reply-To: <20200519201912.1564477-9-bigeasy@linutronix.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.126.201.125] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-CFilter-Loop: Reflected 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: > From: "Luis Claudio R. Goncalves" > zwap uses per-CPU compression. The per-CPU data pointer is acquired with > get_cpu_ptr() which implicitly disables preemption. It allocates memory i= nside the preempt disabled region which conflicts with the PREEMPT_RT seman= tics. > Replace the implicit preemption control with an explicit local lock. > This allows RT kernels to substitute it with a real per CPU lock, which s= erializes the access but keeps the code section preemptible. On non RT kern= els this maps to preempt_disable() as before, i.e. no functional change. Hi Luis, In the below patch, in order to use the acomp APIs to leverage the power of= hardware compressors. I have moved to mutex: https://marc.info/?l=3Dlinux-crypto-vger&m=3D158941285830302&w=3D2 https://marc.info/?l=3Dlinux-crypto-vger&m=3D158941287930311&w=3D2 so once we get some progress on that one, I guess we don't need a special p= atch for RT any more. > [bigeasy: Use local_lock(), additional hunks, patch description] > Cc: Seth Jennings > Cc: Dan Streetman > Cc: Vitaly Wool > Cc: Andrew Morton > Cc: linux-mm@kvack.org > Signed-off-by: Luis Claudio R. Goncalves > Signed-off-by: Sebastian Andrzej Siewior > --- > mm/zswap.c | 23 ++++++++++++++--------- > 1 file changed, 14 insertions(+), 9 deletions(-) Thanks Barry