Message ID | 20221024161213.3221725-6-senozhatsky@chromium.org (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 07FB9C38A2D for <linux-mm@archiver.kernel.org>; Mon, 24 Oct 2022 16:12:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 97FA794000E; Mon, 24 Oct 2022 12:12:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 92FF8940007; Mon, 24 Oct 2022 12:12:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7F7D394000E; Mon, 24 Oct 2022 12:12:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 71F1E940007 for <linux-mm@kvack.org>; Mon, 24 Oct 2022 12:12:40 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 2E4DE1C649A for <linux-mm@kvack.org>; Mon, 24 Oct 2022 16:12:40 +0000 (UTC) X-FDA: 80056336080.08.D76E98E Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) by imf02.hostedemail.com (Postfix) with ESMTP id B71C08003D for <linux-mm@kvack.org>; Mon, 24 Oct 2022 16:12:39 +0000 (UTC) Received: by mail-pg1-f173.google.com with SMTP id s196so9072819pgs.3 for <linux-mm@kvack.org>; Mon, 24 Oct 2022 09:12:39 -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=NPUA49DxSROeuVXUf5+5dYRiCRYwBmJzY7QehiBfLmI=; b=EV/G2vlr9ho5Ulkc8sroUJ+aLbRJoO3MY36vm4QL6xhuYyNjpL7Ar87vrlrAZ5Svm8 rbhIxyNU/WCYSM4dKZqJeI1a0HC2RhQzSx8q4R8RoowxZFSpPbFNOdbB5yGxYkkko3BM jE8lRkc7rPtLERNeVljXsu9Q7FuZGB/Z+DT7o= 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=NPUA49DxSROeuVXUf5+5dYRiCRYwBmJzY7QehiBfLmI=; b=zPOsWfgmU5Y1dzBT9jCutdNYKaUkvTP4pwpIqGXlBhuNP4MGQhJGoNNpDN8uuqbp8x SD4+antecPtJ7H/++f31rIDInZ5d6+25UpizWtObX0zXVqZOgcGUjsuAsinhrv5okoz8 /0QoYkgMDE28xJYbofVP9GT6RZyp9IjmVFmIGYp/dmcJD1t073AtdgeCN9kLpfxTmfti TFoEfBPQ34kmD+9qE6dZJa2uoPjcI1wjmKRnco8gXocJ7gPQZvZpvlTpqfLtzOPTuJBY PFwFG29uXJlW3d/Dq9yUuzjh6uhh42CA2pJah9HOYrS99rJv14IRr0j8RZVv8RtSheIw w3uA== X-Gm-Message-State: ACrzQf1ZtHnSXXPaMkek2z/EBBmRnrl+RxteoqCNeOA/Ly7IzkRjWxID 2e/cRIRkRxeRJYqzFW9LhXV08Q== X-Google-Smtp-Source: AMsMyM5EFonOvy9fopvLRpCC4i2nP0zFo2rQ8ji+mKGlGBkOOwBqhOvFwJ26jDpavxcsyKnsulMEAg== X-Received: by 2002:a63:7304:0:b0:46a:faa5:700f with SMTP id o4-20020a637304000000b0046afaa5700fmr29794719pgc.253.1666627958807; Mon, 24 Oct 2022 09:12:38 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:5f9c:c5bc:902f:3da4]) by smtp.gmail.com with ESMTPSA id u70-20020a627949000000b0056b8726d2d3sm5162pfc.157.2022.10.24.09.12.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Oct 2022 09:12:38 -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: [PATCH 5/6] zsmalloc: break out of loop when found perfect zspage order Date: Tue, 25 Oct 2022 01:12:12 +0900 Message-Id: <20221024161213.3221725-6-senozhatsky@chromium.org> X-Mailer: git-send-email 2.38.0.135.g90850a2211-goog In-Reply-To: <20221024161213.3221725-1-senozhatsky@chromium.org> References: <20221024161213.3221725-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1666627959; a=rsa-sha256; cv=none; b=EMGFVh1LEHcx6yS3C83tucRiv/iuADa4G2zbV1o5PvdMB45e3kghpC4x59RkEgqnKm+8hu RgOy/cX5LZfdl7fsXY4hl7TTaTsCB5cf8TeDSzV1YdCUBXNFb4ht1X6yoQs3w+qrZW6/2L j+oCAY7VA8nD1esFYHUuki3R3ZVF/Rk= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="EV/G2vlr"; spf=pass (imf02.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.215.173 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1666627959; 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:in-reply-to:references:references:dkim-signature; bh=NPUA49DxSROeuVXUf5+5dYRiCRYwBmJzY7QehiBfLmI=; b=P5zoF1DFPJDbjEjtg+quRrXuaJrR0rUk+Ll/JZgtgbPU9qLDL8gmZmwuKJjdPTzYohOJDH 4iJep2byGDU9xhNsWHn34SMoC1z1AbsNp6szuCcoANRZ32RJC1BQ8uSIG8qpCRrsBM4arK nyqYbLirICipDZC1/NtiJBVonLL9Naw= X-Rspamd-Queue-Id: B71C08003D X-Rspam-User: Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b="EV/G2vlr"; spf=pass (imf02.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.215.173 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspamd-Server: rspam04 X-Stat-Signature: f7gpii8rf9yxp7oiwxpa33zato7zkdip X-HE-Tag: 1666627959-419243 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: <linux-mm.kvack.org> |
Series |
zsmalloc/zram: configurable zspage size
|
expand
|
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index fa55e0c66f8d..40a09b1f63b5 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -790,6 +790,9 @@ static int get_pages_per_zspage(struct zs_pool *pool, int class_size) max_usedpc = usedpc; max_usedpc_order = i; } + + if (usedpc == 100) + break; } return max_usedpc_order;
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(+)