Message ID | 20221031054108.541190-10-senozhatsky@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2128147wru; Sun, 30 Oct 2022 22:43:28 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4QuXmgllau1yT2oYPQsVldEgg0L+RrlMJ5DD5o70ZWPRLeCIhsVHRR8hpb12OwEAWmGmpI X-Received: by 2002:a63:6a09:0:b0:43a:20d4:85fe with SMTP id f9-20020a636a09000000b0043a20d485femr11041848pgc.625.1667195007918; Sun, 30 Oct 2022 22:43:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667195007; cv=none; d=google.com; s=arc-20160816; b=jkA4Q97wK9J9k7sRoUPL29/wvunw5cmgDh5HajVNVcfl5RPVnVXxkpTmpWAyQQQLKJ 4mreL16A5/6rzAStd5WZm1bz1AxHpfx/+YqVE+vXV1rWKxzhDgAk/XGvRkW3CU4HIwGm etBHOX1AMRC2GhrKNBuwgOBen8HbLI7kgJAvBCtjL3qe4oBqghl5qd1K+0EgLpK0PH+Z Oqm+NuQr0rkT/NWDEylkFhFsX1iQMC7pYXqmslqV3L98QXQeZvQ7t6hB346lGQxUMtuT tF4Lkk6CUqnN0DojQunKCykR5gujOyChJkDdp9vRaWnyYD0/Bo67UTyK2xozexlOwQ+W B6pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y5bXC0243vzIlXmqJuaoPsZumfjC8+KlYBqtOKgOSLQ=; b=hBoaTEfvB+ShMKiPnfWkk3yIlGtBYPGrTPwxIH4CC8QJoYXN7IWC/xbC+CuHNNOXoV c+ZUec2IIVgI7ia6NdNKZgLkzO0C9pdoz7Ks1Q8MjLtEIzgjM2P9CxZamwTgEAjz50fz i0opYi/QX1LadSH9zmgxNWmGUNvNpy/x9I47f8KeEN5AlSrN/7DbVgsmA/+jyf389dD6 GzHmk3fr1cnU+nHaBg8FYwLg3Z9N9QByAJBxKGtd5XSWFdJ9m2/Jsx2k0deXixLVwIq3 T2JDueT1H26aEDMMIM3isyPx065PGgdETkpiMby1LPsaCQoumr9uES+c2oG6UsKKKCuk LuxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lFlf2oVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h30-20020a63531e000000b0045f74df51e4si8264686pgb.803.2022.10.30.22.43.16; Sun, 30 Oct 2022 22:43:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=lFlf2oVx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229930AbiJaFmT (ORCPT <rfc822;kartikey406@gmail.com> + 99 others); Mon, 31 Oct 2022 01:42:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229929AbiJaFmF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 31 Oct 2022 01:42:05 -0400 Received: from mail-pj1-x1036.google.com (mail-pj1-x1036.google.com [IPv6:2607:f8b0:4864:20::1036]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0644CC76B for <linux-kernel@vger.kernel.org>; Sun, 30 Oct 2022 22:41:40 -0700 (PDT) Received: by mail-pj1-x1036.google.com with SMTP id r61-20020a17090a43c300b00212f4e9cccdso14920316pjg.5 for <linux-kernel@vger.kernel.org>; Sun, 30 Oct 2022 22:41:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y5bXC0243vzIlXmqJuaoPsZumfjC8+KlYBqtOKgOSLQ=; b=lFlf2oVxRN2VsF9XNYteCD5RC9CGXPs9NIzyXxdrHmGL3x5ZbjCN4GvZDcPFRlnVBR daPvQtBhbBGUiA1cThKv+Xl9u3TMaERvo6NWER2YakMLm4rZdmtKCnSpTsLeGXVGwzvT mABpkqu6zE8My3T25QD1KwXgG5k6ux50h9GNw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y5bXC0243vzIlXmqJuaoPsZumfjC8+KlYBqtOKgOSLQ=; b=c2XqMZaaf8cbucyyjxr5DQmlXLu67GkHv82GVQ0Z5C8/xmJlHXAqx8cj5dVhP7gCXk MEVYsw28wJILPa7prIrRIq0t+2cRdoggnwx1o4mNkReBSotSsCPUJjxzo+e/xoSl4amY m5Ga6Ej4x+TVNCmmoa+YjCbYmL8fAf8YGcC1yMtVs0UlqAxoyWL/iigcaHAPyk0LvQkB k3jGa1dlpUZ/J/llLuZpgNXqvGQdiCQENLDqsFTiehu2z+4WsAgWZBuR7cNmgZMeBawC AYirq/fmq5LwC77pjHy/4NyeFmZBED2KtXMjh3h7vE5BsW+JpXozWSQBpnFXi0iDkz3C cSLw== X-Gm-Message-State: ACrzQf25AU7bUj3ytYRP6OX0rgwd/dH7vqFU7nqtxYvu9grjo/yF0N98 YazaZLAx9vstzuuc+yKL1uym2w== X-Received: by 2002:a17:902:e402:b0:186:6f1d:b463 with SMTP id m2-20020a170902e40200b001866f1db463mr12461840ple.23.1667194900136; Sun, 30 Oct 2022 22:41:40 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:7616:afe0:ba6c:96f4]) by smtp.gmail.com with ESMTPSA id w12-20020aa79a0c000000b0056befcd7958sm3573308pfj.84.2022.10.30.22.41.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 30 Oct 2022 22:41:39 -0700 (PDT) From: Sergey Senozhatsky <senozhatsky@chromium.org> To: Andrew Morton <akpm@linux-foundation.org>, Minchan Kim <minchan@kernel.org> Cc: Nitin Gupta <ngupta@vflare.org>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky <senozhatsky@chromium.org> Subject: [PATCHv4 9/9] zsmalloc: break out of loop when found perfect zspage order Date: Mon, 31 Oct 2022 14:41:08 +0900 Message-Id: <20221031054108.541190-10-senozhatsky@chromium.org> X-Mailer: git-send-email 2.38.1.273.g43a17bfeac-goog In-Reply-To: <20221031054108.541190-1-senozhatsky@chromium.org> References: <20221031054108.541190-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748180672404887629?= X-GMAIL-MSGID: =?utf-8?q?1748180672404887629?= |
Series |
zsmalloc/zram: configurable zspage size
|
|
Commit Message
Sergey Senozhatsky
Oct. 31, 2022, 5:41 a.m. UTC
If we found zspage configuration that gives us perfect
100% used percentage (zero wasted space) then there is
no point it trying any other configuration
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
mm/zsmalloc.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 42987a913f45..a40c548520d3 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -787,6 +787,9 @@ static int get_pages_per_zspage(u32 class_size, u32 num_pages) max_usedpc = usedpc; max_usedpc_order = i; } + + if (usedpc == 100) + break; } return max_usedpc_order;