From patchwork Fri Jun 23 04:40:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 13289965 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 E4613EB64DD for ; Fri, 23 Jun 2023 04:40:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1BABE8D0002; Fri, 23 Jun 2023 00:40:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 144218D0001; Fri, 23 Jun 2023 00:40:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F26A48D0002; Fri, 23 Jun 2023 00:40:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id DEF9E8D0001 for ; Fri, 23 Jun 2023 00:40:33 -0400 (EDT) Received: from smtpin25.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id A009540CC3 for ; Fri, 23 Jun 2023 04:40:33 +0000 (UTC) X-FDA: 80932761546.25.C1881AE Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by imf24.hostedemail.com (Postfix) with ESMTP id D009218000C for ; Fri, 23 Jun 2023 04:40:31 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=iB6lBo9Y; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf24.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.175 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1687495231; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=62yt5qVWyoZQmnreF3LrrB9sgJCoX3gsQ54vlPJGid0=; b=E1SlAD1ookP1juX2WSwcslZGo7rNXMKwxmrraOfi5XCnVkZOUg8Z2VOs7opVE4T4Gvy8ck LvGqlSwO0xNbI3p4RTBGpt4EwmqRCQQJfZOeFZhwTn1KFj2ykQ9UrkuAW7/r+Sbud3NfZ5 Gky8lFmqxD3uS4Nyl0ZUkZO3g6cA3Z0= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=iB6lBo9Y; dmarc=pass (policy=none) header.from=chromium.org; spf=pass (imf24.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.175 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1687495231; a=rsa-sha256; cv=none; b=KnxGJk/rbUMT1tjmagvaYIPSyNFweqaBFqjkBSP5XE7KwyOwfysAcQ6y6RXeQ7oJ3SSvM3 PcvMCDhGEn1ZqKB2n/gV9E9nqA8dUAUqvfxYguD96O9zMQ+vCVDjkmOPGUBarQbBHRP0Tr uL+28605mIb9GHp5yH6DnTufjDabcPg= Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-666e97fcc60so50463b3a.3 for ; Thu, 22 Jun 2023 21:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687495230; x=1690087230; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=62yt5qVWyoZQmnreF3LrrB9sgJCoX3gsQ54vlPJGid0=; b=iB6lBo9YwW5MgxYwZFgqhOkY2MxLda2QRoe6bpJZpeme26dHBnK6VhAXCfJUBu+xGm 3qvoaIz/7mOcBKwqVYbH8g81LomgB5PwVv1TfUl5a7Tga0XN0c7Rcl/hRAkTai1BM3i3 v/SmCCfyPDaATunRcie8miSfjxwrzo/Md1mtc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687495230; x=1690087230; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=62yt5qVWyoZQmnreF3LrrB9sgJCoX3gsQ54vlPJGid0=; b=GAyTSR8QXOFd0fgYhJ+UTpB49WgI9qIP/Pu0Hth+Re4veAZMp6NwlWiN5zAr501Wa+ 6KKAXTYZKMM1FJk9Ha8xi/tXQ27UD/MYVPiPq7kweSh/X6ckTluu/SWJE1RmB3VeAGfG zt5YI9BXiQ5K4tdNk0RxrDSokvGljhwqOBythGTogEe5MoTUMuRRSL+s7Dc5Oyh8dvwF Tkm/4a9uPVzqPxQBb7UcEnRd6YA2v7JqY2/N46gpQX77FbMZFLNK9duUE/uQqc4dodCe L0K/FGn5r448e8AQCryU0MjTJ90TPFWA37cS88PRx1tYfvV6I70SnwCmrzQTe8Ceqp8c 4HxA== X-Gm-Message-State: AC+VfDw9BXFQBGPUkvwI6ujUtFyOqzwXZGcu0DOxhmcgoOOcYbomN+Oc lXtp0osZ+VomUgIjL0Hyywwaow== X-Google-Smtp-Source: ACHHUZ4nvSxBGFlp+fUxX7rPsn7nYj1O3hJIW5FGy0KeqmrNziwV+VCGCbKU2VgiXahMJHhVvbgzFg== X-Received: by 2002:a05:6a00:24d5:b0:66a:5e6f:8b21 with SMTP id d21-20020a056a0024d500b0066a5e6f8b21mr3276075pfv.2.1687495230542; Thu, 22 Jun 2023 21:40:30 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:3383:b451:fa2:1538]) by smtp.gmail.com with ESMTPSA id q25-20020a62ae19000000b00666e17004a4sm4237350pff.58.2023.06.22.21.40.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Jun 2023 21:40:29 -0700 (PDT) From: Sergey Senozhatsky To: Minchan Kim , Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCH 0/2] zsmalloc: small compaction improvements Date: Fri, 23 Jun 2023 13:40:00 +0900 Message-ID: <20230623044016.366793-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: D009218000C X-Stat-Signature: c9wezusp3qz4qyhhj76ksytpzc4sfqtd X-HE-Tag: 1687495231-481851 X-HE-Meta: U2FsdGVkX18VWVqYfUS7YOGrgRCG+SzmUsL3Di+I54tI/eC2/7ACXp/XpNbtcqsfa3Cyi4nMFdty/wPyfAAwkxBOsrbU/d+yLB6goOVqCeib2JlNd3MXPqXOtFlVnde9gjFYkOc07IGTPo5kI7solDo6mDca07CyRel7SqT0DhSeEAXD4JRyGDp8OEyBxEDbcmbSckNp1fHXbneV+ck5F9Ne4+ylT6OhFd2KJRz7lP7EPmWpDEdN5mLF7Maxqui07MOBPs9V4jdVI4Q5QfwiT32Q7YchshhKjvd9mFtSg3K/4MTyDTVZFOhfZdoIGvTCMzU//RfHWAu0XfxSYwUSNYW//3sn8TO5HuS6FMCCZK/tfbaQYTYPyMI4LFJt1/Td61sj03i4vBq1I2tDMK6aHDj1x/6+ryZs5e9VbG7w8Wc4DmrurKFqNTNtmZ+/O1PxSKCnshasS0shSQNOdJ55JJwwSF5PuulWEZkFC2JBieg4TOUewlVDRY5ij/skA9ohDmUkJ3UbxtcmDCjpDuaFBTTs4i2QgTetZrIihXSsuOAHe2zJ7VS4NjnCxXFdNug/TsL4EQU604BRf3rYQ2bztRdaett4DEgvHa35gdxlvtqwe9xFxuBTGrnRK0yg/5hv5qUFs28/605ZkFVUoRp1lde4iIYaHX5J6WnqKfqwTQScPeQ5EQmKtr0sJ4rFfUq4K14ZdDOk8uOPh986R6nU42DfSPrOOu0ZKqhIm24sk82gX9FkI9ES/nSU8Q72nYJJg9PN4gSKmCCuKPvjht3DbIvLE1jSGjX0MWim0qTg94v83pz9mrM1ZVz4Mi8/w0/+PrK1tIBjTVKXiPdlBh24lFCZq1/y4sIay2T15sOOuIa/u3JxIM82CQGVQ6myvqc9gcize2kkG1AeP1NgJ6lpA1o6HXUU2f7OdP7FCu7rp+0xVx14uG8R7bmrNj5awIgRuNc5VwhgaGay1hfLaNp 9rleLkse Vb3SRHlC/inCEUZrHmfWj1E4BJf2IysHlx6Wee63b1rdqbEXNKQ5pMHAHphGuDfupoHVB0Lh67ewL6relZltc/zb02ft0ftJipcrq7rF9pJzUJeyL5re3P1YdCSsbAcbLfsB1JmjRHKnHQiE0SJUEK/9gQBumRVLAUF7RD578sMVZV4gu28UcxyVuDwA2B9FvmaDpT5x5U4lowObiNyOfkj7PpIhWZB/n/zbSheH6cK1a9pX2QfeZXrM5/EkscKHJBjP72IoLtAdF702Jd3bbIQm/e/2fLpuFxpiXGXhI/dqoqw0YzF7aAJ7/dvikF+zYEp7KFCKX8nXJZu88fy45dEiduqFGFnGN7Mar X-Bogosity: Ham, tests=bogofilter, spamicity=0.000013, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, A tiny series that can reduce the number of find_alloced_obj() invocations (which perform a linear scan of sub-page) during compaction. Inspired by Alexey Romanov's findings. Sergey Senozhatsky (2): zsmalloc: do not scan for allocated objects in empty zspage zsmalloc: move migration destination zspage inuse check mm/zsmalloc.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) Signed-off-by: Minchan Kim