Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp2414414pjr; Tue, 19 May 2020 14:48:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwe0PzjuODadRfLcYxW5dTBJ0JS7gpBJvdnzBYZNyHhFtDbvvytBsSVl7a3WEhvV4ClumY2 X-Received: by 2002:a05:6402:31b1:: with SMTP id dj17mr777710edb.142.1589924893268; Tue, 19 May 2020 14:48:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589924893; cv=none; d=google.com; s=arc-20160816; b=yIjakh3sueJA5qHxjqHxXV3TRX4ZNpM86VbmTLBpK4RxmX/RI8R/zUskl6zgfRDbZt 8Lnm3fI/Yeaqo5vjeGyyUBaXY4tORl/8ewOcjN7Xsjtvy+qcd6KaZUhGj9hKyPwBKEMw jzUdggLGyhNBLOncHwi8fNLHIBhp7sE3QkZaffT5D/yOyg7b7dp8uiMh3/C8A+80/2Yn +RrEp3/62xi+e1GRwliquFG/zJOzyod59PM5qfhVT6xfrqguN/xJdV0qVt7MQQ0sOsoe /WxPnjuDBsDJfqqKdcJoXxfZFmBU6XQq7A+0mxl+9OJMeXHugtrT+Wu2dFsxYPbUgBw+ j2FQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=e2ylIP0Bayjy4MQ161uYgetccTy9EwjTl782eoga4mw=; b=VewBj1l+zJNMQ5ThNZBnSilIHQjBfXScYBgICwHoWbA3BtFyBnyhOHAOfk5SIZ9mGh Eo2stllqFN29wH2fpU+ubWxwxmJXVfefQR0hLcsrQ3Mu96iGLWIktWNSbN6682ECe5IU OZ+Sd+VvTJ6BK193CSgtmWitBalCP5qk7NqGi3heZ1QI2mLCuQ6x9pAbug7DzZ6o9eYW 9XxySR2Fqt/oV2Ui+Hizb1zbehYXZl+8gnskeqRl+rdbK4VrT0+aiHCcr+wP61yb+l+p xZmxqVU1qFKGnCtQF7c53kbVffX3jTHW626cnzmoBBJ1Msb39WLVeu/ZUHOfYjBjfu91 Xrzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si337145edm.473.2020.05.19.14.47.50; Tue, 19 May 2020 14:48:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727833AbgESVqS convert rfc822-to-8bit (ORCPT + 99 others); Tue, 19 May 2020 17:46:18 -0400 Received: from szxga03-in.huawei.com ([45.249.212.189]:2506 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726030AbgESVqR (ORCPT ); Tue, 19 May 2020 17:46:17 -0400 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: 8BIT MIME-Version: 1.0 X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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 inside the preempt disabled region which conflicts with the PREEMPT_RT semantics. > Replace the implicit preemption control with an explicit local lock. > This allows RT kernels to substitute it with a real per CPU lock, which serializes the access but keeps the code section preemptible. On non RT kernels 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=linux-crypto-vger&m=158941285830302&w=2 https://marc.info/?l=linux-crypto-vger&m=158941287930311&w=2 so once we get some progress on that one, I guess we don't need a special patch 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