Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp3845994rwe; Mon, 17 Apr 2023 04:34:57 -0700 (PDT) X-Google-Smtp-Source: AKy350b/yCZAFKoJB9iJh8KT9nuPaDb/2IfUo6i1hzV/YyQssZPYUu21d96y9+Lfms8TeeMHWPaC X-Received: by 2002:a05:6a20:8427:b0:ee:454f:11d8 with SMTP id c39-20020a056a20842700b000ee454f11d8mr13941644pzd.40.1681731297531; Mon, 17 Apr 2023 04:34:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681731297; cv=none; d=google.com; s=arc-20160816; b=Og3HD1HejB+wWhofDWLraiz3t4Bl6/NhdLNKWgS3ZhT1CYjZSUw16z4Ps/y+euvLPW kn9DLkKDwNoqJ5ScBkDeceL8BmVYnJN5M+mTwg+aw9x/baKp9ajbaBk8OV1jgURPUXCP IAjXfunbd0rLiGB3cbnxA5FpogqO/1gnnVAVAwHMoZgdTybPd2UrcHy8K25reypA0ME+ SlOi5G1B/nZ1wnVnyjVDEctaOfgBlAaPFFwtYhRPBctk9RHXcp3loPlUkTqsUZXKPr7y NORfL++0k1FGrRHavSgEE7+q2m8wJ4Qj8Q/Z3t8owuA2huGmbzd+SYwLNju0gSfR6rX/ ceiA== 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=7LkCrILb9IuvbZSWvzfLhM66GWJHFdrMr5qCX1S/DkU=; b=IZw5mwyhmpwWPtV2ff2tcjbsNwFMAqUWtf4F5QHDgNkcltWROvKQaFrpOno9Fy5MQf jiwJ/PlCWFuNmmvv2fKQycn4PPzwg1A3e7bRhT/hZzforl/lvqynx3+A3rvWVaTa0Be0 fI0A79WBR3SriPmHBmu9XeYNz+FmwzXOkZfeEvqLGIfKyRJLzwlmJwn7VBL10hgdQvwK 7iAmnCE91kSb7hs/ziLUZ6Z/U2hPsiib/lhuZlK2rhs5z+QoUeCk665t0TKYmMSi4Q5Y JeKoOxcZYD50BIalKbqLBWWtikgj6IB6HcgafIwsHJwnBdQy2Kp/+pNzZ09LBgVHwC// F3eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KbNyF8OB; 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 t16-20020a63dd10000000b0051b54dccffcsi10745629pgg.827.2023.04.17.04.34.46; Mon, 17 Apr 2023 04:34:57 -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=KbNyF8OB; 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 S229971AbjDQL2u (ORCPT + 99 others); Mon, 17 Apr 2023 07:28:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231254AbjDQL1R (ORCPT ); Mon, 17 Apr 2023 07:27:17 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA4D4232 for ; Mon, 17 Apr 2023 04:26:16 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id n17so9300519pln.8 for ; Mon, 17 Apr 2023 04:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1681730666; x=1684322666; 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=7LkCrILb9IuvbZSWvzfLhM66GWJHFdrMr5qCX1S/DkU=; b=KbNyF8OBDiZXi97ZYaJA3QSSRzMsa69uKIMSClYQLH6b2Rr0cJ8pwnj2pxQjcxY4x9 M+UmQ4Fe0QgmEixYvr4iJk85QxnXlY98AysCnXpD9iJGhMBJMaijD+5kQtlsMUJkuSMt RoybIcdHz2bg0TbSJH5AGv6Rj7DTOs+TGzjN4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681730666; x=1684322666; 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=7LkCrILb9IuvbZSWvzfLhM66GWJHFdrMr5qCX1S/DkU=; b=Cf/8wsUriYvctCdYWJ0oE5R6OJbOWcgBZEEpPCcQhigOSsmMglcwjvybeZqPtcxZTg C9bhjcLGhSkACZahSZpkGqOsewxPxyh5YMZIWHmmPzKafz5yQbs3/yvBvjuKA4XXhrAM Kk99JFR72WbEY1FSZdV/qIU3GMJ1QHk6Y1TBnIXAqQyIfS8KtvTGfmg+uLn3T/3R3Hxv RBWULhd0q6JhcZjoDAdKrLlFD9oFYCCcrIILBkIeehvCskURo8XuJjnE4ATq9skAM6kS HkJjeX7lhGBxbrOREVGV+gYAoZYfkIEYtgurONBakCIcHUhXVdEdkuTJ+YTkmSubNxWn RmSg== X-Gm-Message-State: AAQBX9df4BU+r1Dot4gZWKg1GRPVm287KN+p69l+QVbr5aEFQHChHMmQ nLN9YlKQBhzNgfEiKoLVYH2HHQ== X-Received: by 2002:a05:6a20:7aaf:b0:c6:bd82:ea2d with SMTP id u47-20020a056a207aaf00b000c6bd82ea2dmr14773435pzh.2.1681730666125; Mon, 17 Apr 2023 04:24:26 -0700 (PDT) Received: from google.com (KD124209188001.ppp-bb.dion.ne.jp. [124.209.188.1]) by smtp.gmail.com with ESMTPSA id 142-20020a630494000000b00513955cc174sm6960590pge.47.2023.04.17.04.24.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Apr 2023 04:24:25 -0700 (PDT) Date: Mon, 17 Apr 2023 20:24:21 +0900 From: Sergey Senozhatsky To: Yosry Ahmed Cc: Sergey Senozhatsky , Yu Zhao , Minchan Kim , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHv4 0/4] zsmalloc: fine-grained fullness and new compaction algorithm Message-ID: <20230417112421.GO25053@google.com> References: <20230304034835.2082479-1-senozhatsky@chromium.org> <20230416151853.GK25053@google.com> <20230417024446.GL25053@google.com> <20230417035232.GM25053@google.com> <20230417111243.GN25053@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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/04/17 04:16), Yosry Ahmed wrote: > > That's a good question to which I don't have an answer. We can list_add() > > the same zspage twice, unlocking the pool after first list_add() so that > > another process (including another zs_compact()) can do something to that > > zspage. The answer is somewhere between these lines, I guess. > > But the first list_add() is (in this case) the correct add, so we > expect other processes to be able to access the zspage after the first > list_add() anyway, right? Correct. Compaction also can unlock pool->lock and schedule() so that another process can access the source zspage, when compaction gets scheduled it can attempt putback/unlock the same zspage one more time (the zspage may not even exist at this point, I assume).