Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9409393rwd; Wed, 21 Jun 2023 07:09:07 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5mWIOfLJ28QH7H1m5vbwqbtkAU/iZ6xHBlsPMfnKF4RWnc2GOO/EUISIPrQDx4CewL+j5l X-Received: by 2002:a17:902:ec90:b0:1b2:450f:99e with SMTP id x16-20020a170902ec9000b001b2450f099emr14591684plg.46.1687356546818; Wed, 21 Jun 2023 07:09:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687356546; cv=none; d=google.com; s=arc-20160816; b=VpL6xi5/GjKqD4VIh1OkuPWAKn2eZ4U4JpVrEB2hUQPkcv6HSvs1TPlRgYIeyKRKvI YyezOFSAe54SrbTkuWQ3XEeAfBMjO0ttLP2z0+3sH1K0WBUEGpnUzmT1Aff506ADwJAl wk5YeWRTSpJkmr0x4GFfa4qJ1xkKZXLXLB0So8gL7FHY9kLOM3p64wx8CiOfs1m0lBOO Pk8vswM50slP06yVP3pA9jUXJOhA3TIJfVkkKcrAzaCtOS0kURKj/dcU4gV0R6Bw6Zwi TbAMvjnbczcWHCy5cZfJk7zMd4BFIjDKry33WOh45swGLbw0S3/o+Anr9CKo0NFykaib xynA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=p4pHQjZOMqBN5NmKCmx+GJA0YbJi+vSazVFlD7bdpAk=; b=kwMqDgVtpqSNk16QqJriRbCRC09fw4nyd4I/DIaoZy7Lr3u/HVQ8mIibEtVtpsnooI 2qTqc4ArXAFcnphudkQH/okHMkYFZ+MAzhfRAAcJ9PYXSxnibGrLfOMRKWD/yoEfk3Xv 7rarQYtFp3V/YfRPYTdhHyuA6bxCbzMNe796tcKdZTV07O6Ku1rV1kshlrOPYFeg10am aoFM4YEvNgPHWiimrnXYpS8YSMIvV5c9atVOcZPD+qqTU4ke5ViciJiChx9hKyrfojKc GQFz9zNsAIMlkFBgz9v6Vbkr5AEn2l8eUzOBEYOwOUQqUjOvUGp/FST5ntf/e6Hf8M4R 0irQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="Q/7FQuLc"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m18-20020a170902e41200b001b516b77c42si3950014ple.402.2023.06.21.07.08.53; Wed, 21 Jun 2023 07:09:06 -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="Q/7FQuLc"; 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 S229867AbjFUNzb (ORCPT + 99 others); Wed, 21 Jun 2023 09:55:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjFUNzY (ORCPT ); Wed, 21 Jun 2023 09:55:24 -0400 Received: from mail-oi1-x234.google.com (mail-oi1-x234.google.com [IPv6:2607:f8b0:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B61C0E6E for ; Wed, 21 Jun 2023 06:55:23 -0700 (PDT) Received: by mail-oi1-x234.google.com with SMTP id 5614622812f47-39ee19cfb77so2234899b6e.0 for ; Wed, 21 Jun 2023 06:55:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1687355723; x=1689947723; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=p4pHQjZOMqBN5NmKCmx+GJA0YbJi+vSazVFlD7bdpAk=; b=Q/7FQuLciu+yygCZvdriuhqDpOo04n9GD+hoY8dGXfWSHIZ6JOkYjl7Uv1RyT+nldf MMRVtI2vdWUyy7i+d5ulQvEheHoRH/AYXdV13q2P0gKy5ld5zvg7/a3JlkEFyzWCXAZe H4F7X7uTDAk5YuehaJk6iYEivkQOa6cjq/WmM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687355723; x=1689947723; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=p4pHQjZOMqBN5NmKCmx+GJA0YbJi+vSazVFlD7bdpAk=; b=PC7YBVMDaPNO49H/6wvOpL32L/6+byBS/CerxT51PKaTKWDSxvG9FEJsbLwQ59fv86 Y9eYgCvTNyxhj5iC2qYHj0o9O95Et4mkNZCanBeabJcStdft6uIjLmyOhOiXUW71W5Tx a6Vduc0kkhs/HYdSvrHNux1ZwU37UCgZP9XivuD+xygJ8xERod9sIO/4wdAFtsZPjwNy kcNlF6xfqBC/Vj62Rkjnmb4LfrhvNyhleCO17sceUGrR1GYnL8PK0Qf+lad4LmX/2jAA yn2+wcdVCnUfx4gIt3++by4wT2sbvqRuaO4X8ewqavKcQEGiLyUZ5izxaw7Rf92t8wLk ySJA== X-Gm-Message-State: AC+VfDz+LQ65AdcJFO1NgH/SdmLMMlDWgfb0+ScGXHtydiDJQJor1AB5 /gluisTaakalwJ17wt4vx31l4A== X-Received: by 2002:a05:6808:614c:b0:3a0:3a17:a146 with SMTP id dl12-20020a056808614c00b003a03a17a146mr4511810oib.57.1687355722979; Wed, 21 Jun 2023 06:55:22 -0700 (PDT) Received: from google.com (KD124209188001.ppp-bb.dion.ne.jp. [124.209.188.1]) by smtp.gmail.com with ESMTPSA id y17-20020a63e251000000b0050a0227a4bcsm3163906pgj.57.2023.06.21.06.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jun 2023 06:55:22 -0700 (PDT) Date: Wed, 21 Jun 2023 22:55:18 +0900 From: Sergey Senozhatsky To: Alexey Romanov Cc: Sergey Senozhatsky , 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 Message-ID: <20230621135518.GD2934656@google.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621134130.tm2oucg5eskelwzr@cab-wsm-0029881> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 (23/06/21 13:41), Alexey Romanov wrote: [..] > > +static bool zspage_empty(struct zspage *zspage) > > +{ > > + return get_zspage_inuse(zspage) == 0; > > +} > > + > > /** > > * zs_lookup_class_index() - Returns index of the zsmalloc &size_class > > * that hold objects of the provided size. > > @@ -1787,6 +1792,10 @@ static void migrate_zspage(struct zs_pool *pool, 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; > > } > > Yes it seems my version is not as good as I thought. Looks bad for an > architecturally dependent PAGE_SIZE. [..] Well, we are looking for a solution that is both reasonable (perf wise) and is maintainable. > I can implement this option. I'll test this and send patch this week. Either that or, if Suggested-by: Alexey Romanov is good enough for you, then I can send a series tonight or tomorrow (after some testing). I have two more patches on top of that one.