Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9439580rwd; Wed, 21 Jun 2023 07:29:41 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wIzcpYutKmnMFZdRI7Nq0ckFV+8ly4wOFa3knR0FE3wUv0o4cWXVCeNLhNUkr5OckRi2T X-Received: by 2002:a17:902:8c94:b0:1b1:a9e7:5d4b with SMTP id t20-20020a1709028c9400b001b1a9e75d4bmr14660341plo.22.1687357781046; Wed, 21 Jun 2023 07:29:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687357781; cv=none; d=google.com; s=arc-20160816; b=qEAfhROkAvsEL+lJRkAsUAluPkC2/B2BAcJvX606g8SiOY3JRas6LdKoYUosaWC3PV sEoCoIjH97qZR6IPDOfpClwI3/ORvDLuv8XgFxk76tT9Db5ucxlCq87yDGj9d6HC5ZBP oDaoxxC61HPo9areRPK1hIOqLIkWYT7suhbRiU+s2BWwymhRcMlyxNlESnePtnTViAgm P9HwYdgY7nafmasoqHuTbFozKEry1vFKa5zTUtSrFSeK3QbnEH0ogJnRCZhm6qza+7nh qS+HjbagIRmODqk70yOPSYHOpoCrtTc/mtJpFSc+aRw19Spa+8av6lotD2FHejDNbMOi klmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=zWFbewBe5gfGgxwvybbxWY3tmBMH88HB0q4OqowM55g=; b=u6i82BMDBTN0QzwF9egugBmEhIYfWn0cWPJSXxXpv07WLoEKjYnL8zB7KLPQoeVkYr TYEpJE5fa7vrIb9c1keVR+6LYgtyFN0XrMp92qr3O8ilWM8UeexPORkrMD0dI2zUr7e8 wajgO8aq1ngkrDbrR8G0WprpHxaIAuuUUI0TLuQn6e3os86epwA8dEEFn+iGyLoz1+w0 XD1W6+64Iyj65ixIrnxwX4QOc+iYYskE5tbnwX42BWrd9CQJBLYTVCTQqV2LH7AuuLET rvb3ZnZ8vcTIIKZmcT0xu1AbLk+PLDbDufe3Rqp/PyaZ/zNZa1BoaSgJn8c0fQywDpK4 /jHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=REuh7nlI; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n17-20020a170903405100b001b51c68c828si775198pla.211.2023.06.21.07.29.25; Wed, 21 Jun 2023 07:29:41 -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=@sberdevices.ru header.s=mail header.b=REuh7nlI; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232471AbjFUOAq (ORCPT + 99 others); Wed, 21 Jun 2023 10:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49298 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232476AbjFUOA0 (ORCPT ); Wed, 21 Jun 2023 10:00:26 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF2041BF5 for ; Wed, 21 Jun 2023 06:59:46 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id DDDB65FD89; Wed, 21 Jun 2023 16:59:44 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1687355984; bh=zWFbewBe5gfGgxwvybbxWY3tmBMH88HB0q4OqowM55g=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=REuh7nlI6eKQgPgchgREMfasK9VVxf4ZLeudY6Tp9LHidWn1d+qtZljMcxlveqXD1 dmPZp4MR/YKBuNtXtGpk06GCX0YfvrpUomIO5T4/z0nrCYKQLH8kmfy6snssQIbT1r crSzOAJ7yFB4VY2j7Cuc+sadc9rrNDGxWpD611oD84NyhfonYPunHf2IWR8QPGimLy 3oj9PFa5fkkeXRRHbZSPOCR7OZRq91ijgfzESIcNP/pe3qwmFuMN8I+easwEMbJDLl iWqmyVcICjmwu173iFRTPG+wwwl+awe4o65tvW/2j1zkdCv6aNoGMqd30WnWWkkj86 tQNyYZrI85Uxg== Received: from p-i-exch-sc-m01.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 21 Jun 2023 16:59:44 +0300 (MSK) From: Alexey Romanov To: Sergey Senozhatsky CC: Minchan Kim , "akpm@linux-foundation.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , kernel Subject: Re: [PATCH v1 1/2] zsmalloc: add allocated objects counter for subpage Thread-Topic: [PATCH v1 1/2] zsmalloc: add allocated objects counter for subpage Thread-Index: AQHZortECyHNmKOx4kiy6hdprH0m0a+TTmOAgAALNICAAbQNAIAABsUAgAAD2wCAAAE2AA== Date: Wed, 21 Jun 2023 13:59:43 +0000 Message-ID: <20230621135938.outx6qezuholc3hy@cab-wsm-0029881> References: <20230619143506.45253-1-avromanov@sberdevices.ru> <20230619143506.45253-2-avromanov@sberdevices.ru> <20230620103629.GA42985@google.com> <20230620111635.gztldehfzvuzkdnj@cab-wsm-0029881> <20230621131716.GC2934656@google.com> <20230621134130.tm2oucg5eskelwzr@cab-wsm-0029881> <20230621135518.GD2934656@google.com> In-Reply-To: <20230621135518.GD2934656@google.com> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.18.93] Content-Type: text/plain; charset="us-ascii" Content-ID: Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/06/21 11:37:00 #21545586 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 21, 2023 at 10:55:18PM +0900, Sergey Senozhatsky wrote: > On (23/06/21 13:41), Alexey Romanov wrote: > [..] > > > +static bool zspage_empty(struct zspage *zspage) > > > +{ > > > + return get_zspage_inuse(zspage) =3D=3D 0; > > > +} > > > + > > > /** > > > * zs_lookup_class_index() - Returns index of the zsmalloc &size_cla= ss > > > * that hold objects of the provided size. > > > @@ -1787,6 +1792,10 @@ static void migrate_zspage(struct zs_pool *poo= l, struct size_class *class, > > > obj_idx++; > > > record_obj(handle, free_obj); > > > obj_free(class->size, used_obj, NULL); > > > + > > > + /* Stop if there are no more objects to migrate */ > > > + if (zspage_empty(get_zspage(s_page))) > > > + break; > > > } > >=20 > > Yes it seems my version is not as good as I thought. Looks bad for an > > architecturally dependent PAGE_SIZE. [..] >=20 > Well, we are looking for a solution that is both reasonable (perf wise) > and is maintainable. >=20 > > I can implement this option. I'll test this and send patch this week. >=20 > Either that or, if Suggested-by: Alexey Romanov > is good enough for you, then I can send a series tonight or tomorrow (aft= er > some testing). I have two more patches on top of that one. Yeah, Suggested-by is OK. Let's send a patch. Thank you. --=20 Thank you, Alexey=