From patchwork Sat Feb 13 07:58:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Song Bao Hua (Barry Song)" X-Patchwork-Id: 12086619 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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham 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 329D0C433E6 for ; Sat, 13 Feb 2021 08:04:39 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A628E64E02 for ; Sat, 13 Feb 2021 08:04:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A628E64E02 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 552998D00BD; Sat, 13 Feb 2021 03:04:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 5029B8D0060; Sat, 13 Feb 2021 03:04:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3A3058D00BD; Sat, 13 Feb 2021 03:04:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0167.hostedemail.com [216.40.44.167]) by kanga.kvack.org (Postfix) with ESMTP id 255138D0060 for ; Sat, 13 Feb 2021 03:04:37 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id E714E87D3 for ; Sat, 13 Feb 2021 08:04:36 +0000 (UTC) X-FDA: 77812507752.03.3503B8D Received: from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190]) by imf14.hostedemail.com (Postfix) with ESMTP id D950AC000C45 for ; Sat, 13 Feb 2021 08:04:33 +0000 (UTC) Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dd2sY63HLzlK3r; Sat, 13 Feb 2021 16:02:41 +0800 (CST) Received: from SWX921481.china.huawei.com (10.126.200.53) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Sat, 13 Feb 2021 16:04:21 +0800 From: Barry Song To: CC: , Barry Song Subject: [PATCH v2 0/2] Fix the compatibility of zsmalloc and zswap Date: Sat, 13 Feb 2021 20:58:29 +1300 Message-ID: <20210213075831.10852-1-song.bao.hua@hisilicon.com> X-Mailer: git-send-email 2.21.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.126.200.53] X-CFilter-Loop: Reflected X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D950AC000C45 X-Stat-Signature: qcr1h18snarrspam1uowqgeo3r7y7a95 Received-SPF: none (hisilicon.com>: No applicable sender policy available) receiver=imf14; identity=mailfrom; envelope-from=""; helo=szxga04-in.huawei.com; client-ip=45.249.212.190 X-HE-DKIM-Result: none/none X-HE-Tag: 1613203473-937084 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: The compatibility of zsmalloc and zswap was broken by commit 1ec3b5fe6eec ("mm/zswap: move to use crypto_acomp API for hardware acceleration"). patch #1 add a flag to zpool, then zswap used it to determine if zpool drivers such as zbud/z3fold/zsmalloc will enter an atomic context after mapping. the difference between zbud/z3fold and zsmalloc is that zsmalloc requires an atomic context since its map function holds a preempt-disabled lock, but zbud/z3fold don't require an atomic context. so patch #2 set flag sleep_mapped to true indicates that zbud/z3fold can sleep after mapping. zsmalloc didn't support sleep after mapping, so not set that flag to true. -v2: * folded-merged sanitizer check patches into tiantao's patch1(done by Andrew); * added fixes tag in changelog and refined commit log(done by Barry) Tian Tao (2): mm/zswap: add a flag to indicate if zpool can do sleep map mm: set the sleep_mapped to true for zbud and z3fold include/linux/zpool.h | 3 +++ mm/z3fold.c | 1 + mm/zbud.c | 1 + mm/zpool.c | 13 +++++++++++ mm/zswap.c | 51 ++++++++++++++++++++++++++++++++++++++----- 5 files changed, 64 insertions(+), 5 deletions(-)