From patchwork Wed Nov 10 18:54:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Minchan Kim X-Patchwork-Id: 12612571 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4FF48C4332F for ; Wed, 10 Nov 2021 18:54:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E3DD6611C9 for ; Wed, 10 Nov 2021 18:54:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org E3DD6611C9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 4EE536B0073; Wed, 10 Nov 2021 13:54:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 49D786B0074; Wed, 10 Nov 2021 13:54:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 365F26B0075; Wed, 10 Nov 2021 13:54:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0149.hostedemail.com [216.40.44.149]) by kanga.kvack.org (Postfix) with ESMTP id 290626B0073 for ; Wed, 10 Nov 2021 13:54:40 -0500 (EST) Received: from smtpin02.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id DA41D82DBB for ; Wed, 10 Nov 2021 18:54:39 +0000 (UTC) X-FDA: 78793921878.02.918CAD4 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf19.hostedemail.com (Postfix) with ESMTP id CEE74B0000BB for ; Wed, 10 Nov 2021 18:54:30 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id x7so2273044pjn.0 for ; Wed, 10 Nov 2021 10:54:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Ag5XDRyZMQtZYYWcsdT3aT8qYRpH71e509WiO+RAZbs=; b=knCMp8srrtfTZZcKpfvlJEWgEhMH7Kgv4cqyeV0kAZswBrm21pz1uzGevjzlC+y3GL 0R/N1rNuf5tpRzDEM/CLyAIKTUk0PSYtxalfP8ViHBPh9OYHY5JlwbTla0TgiMgvCo7V zweWJC1jHel3reahjdYf7hjzT+H2gPsEdHLkaCNE7yy/O3zOIo4RmgOaizLj3it+j9h3 Wnx+tII9BHNN5TH+aHevDZr7gMkezPHz32ophrRLyguSj61XllRjevpKOLY7qADPT2ZV 6TshegPHKJHVgXGZdMi/0+AcTgU2Q2wPatS0oRV9yqAeQ3oRJ3xsWHFmNpEZXvC1JNVz ca0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=Ag5XDRyZMQtZYYWcsdT3aT8qYRpH71e509WiO+RAZbs=; b=OmQKTurCueJOPKo8CUoZmJYEz5LyxDDEHMf/66FQxSfsROyQ5spPZQ95QoWPe9gbIz M3+icznLkpPGOMs3Br0oMGR5NfzDQTJy6L0otbcyBOs6U9PnloaXDB8woHDSrMUGe4Yy c4pir2sLcDlohn0MFd5ojN3z5Kd+wWmgcZPYESaFZGtuOe+Vfxts3CXlL9CamUq4FQym OZVF8Cu6yJnN6XBLb8HRHALVc59n6Qb0z52knw0ljWLhcFIK0WCPv3QObJcggKPjSvzc 1dJZl2Q47pKVudCL9y3/kMgWGebPZF9qP6vPID6uEApX1wytDyrP5kY5rtFdqrwFCbvc 4Avg== X-Gm-Message-State: AOAM5339ReHv7aJ3nf6s41ajP1x3mvi7Ak+nlDCS84fPSfcUhsrPDR7c IZhy7W5DWeUQts58h7GFZ60= X-Google-Smtp-Source: ABdhPJyNVT1TO5lRCrp89/iaDmgesCWAhQeTe8hH7Cuwyp+/qR9yVy1WmjEj10NHahh92IGKn96J8Q== X-Received: by 2002:a17:90b:3b4c:: with SMTP id ot12mr19458526pjb.196.1636570478399; Wed, 10 Nov 2021 10:54:38 -0800 (PST) Received: from bbox-1.mtv.corp.google.com ([2620:15c:211:201:11d4:2de3:ab82:be64]) by smtp.gmail.com with ESMTPSA id g13sm325253pjc.39.2021.11.10.10.54.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Nov 2021 10:54:37 -0800 (PST) From: Minchan Kim To: Andrew Morton Cc: Sergey Senozhatsky , linux-mm , Minchan Kim Subject: [PATCH 0/8] zsmalloc: remove bit_spin_lock Date: Wed, 10 Nov 2021 10:54:25 -0800 Message-Id: <20211110185433.1981097-1-minchan@kernel.org> X-Mailer: git-send-email 2.34.0.rc1.387.gb447b232ab-goog MIME-Version: 1.0 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: CEE74B0000BB X-Stat-Signature: 7oc5pz51cdgfsha6aqqobeiqo8gg4gir Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=knCMp8sr; spf=pass (imf19.hostedemail.com: domain of minchan.kim@gmail.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=minchan.kim@gmail.com; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (policy=none) X-HE-Tag: 1636570470-668922 X-Bogosity: Ham, tests=bogofilter, spamicity=0.018942, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The zsmalloc has used bit_spin_lock to minimize space overhead since it's zpage granularity lock. However, it causes zsmalloc non-working under PREEMPT_RT as well as adding too much complication. This patchset tries to replace the bit_spin_lock with per-pool rwlock. It also removes unnecessary zspage isolation logic from class, which was the other part too much complication added into zsmalloc. Last patch changes the get_cpu_var to local_lock to make it work in PREEMPT_RT. Minchan Kim (7): zsmalloc: introduce some helper functions zsmalloc: rename zs_stat_type to class_stat_type zsmalloc: decouple class actions from zspage works zsmalloc: introduce obj_allocated zsmalloc: move huge compressed obj from page to zspage zsmalloc: remove zspage isolation for migration zsmalloc: replace per zpage lock with pool->migrate_lock Sebastian Andrzej Siewior (1): zsmalloc: replace get_cpu_var with local_lock mm/zsmalloc.c | 528 ++++++++++++++++++-------------------------------- 1 file changed, 188 insertions(+), 340 deletions(-)