Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp119276rba; Wed, 20 Mar 2024 12:46:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVSUz50sGJHctLaBoGdwaRDMHiX63kwUk1RWZg+v8nXgnnUjK3UbNbnk8aS8Yu5bOWrLfoz+NXt7Zb32bpzsJHPk+5Gxbpio8jI0hvP0A== X-Google-Smtp-Source: AGHT+IEXHUbQPTAe/GIAd3Lob1ujt27AGjFRp3D8YtzmrqVJL+hf57TE6OH69B7b9stsQ1jDFhRD X-Received: by 2002:a05:6122:12f7:b0:4c0:24e6:f49d with SMTP id k23-20020a05612212f700b004c024e6f49dmr2504857vkp.1.1710964008985; Wed, 20 Mar 2024 12:46:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710964008; cv=pass; d=google.com; s=arc-20160816; b=NblIEzZ867ZZBl2YXqCH5Bw2KzTjdHWVB4+bz3d1x19ZhvrBr4eujaVqfEKsg8M3az 1S3xcTUXCtDgAIa+nTc70GujfMEZ8C4JuFkz+D+/+Rc4hWq7ilFQfDxvn4PIgKyLEfKU Ev3tvPCyB1CVtgCD/zB8H3zzFaO7maQXpSQmIW6D6Kpi6tzPmiwRM4S9fz5TECUI1KdU bhEb0nhnAnSw5s2vX0bMjsv9yFHuDZvaSUpf/DU4GUroXYjhr9osoLTKmp4pE3cQrtm6 zDVxyesUfe/1zo7EU/dWIJrGKF+U9jy2Eu0T5jDy9jqYNgLZLEEzCRfw6xkCAZPnzBqf d9cg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :in-reply-to:date:dkim-signature; bh=XrEzq6bloqFAKXeMdsNDdUP3x8FUbwhce87927qkd+w=; fh=ztbjgXxhqrFUZoUCl/AN4HGO+SifxDOyhbnQVaX8urc=; b=CEdV0olgd+gnZXUz3/nBmxqOxLUO/XR0G4elsQdJ1t1ySO4sBJxd6bJY1fuW6Mcxdo IQXaujxhGBNHafzZsEabyxPYhkjnR3VwdYY7U8XthvcVgQ5K9ArZ+nSu1heRMrMlvmeu 4/GOjI5Qm1+Gcfe9GxI2Cz+LTzfS1LQbmF4rfxzOSwUGu+Jb5qeUq8J4E+FajWHmz8yz SiGFQIu4qjN8ONawrt3m5wpViayURMD29JSZRDx1CMDmytK/5naMXNFIsRjQn6orQysH k6eYCt0L9UI2uIF+yDJfYKxu+xkNTdHnAd/Sx02uZblyvOLFuGVMdqqG/RwqlqpObYd6 3vqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Gdbz4OBe; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id fq7-20020a056214258700b00690dc323cfcsi13312807qvb.233.2024.03.20.12.46.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Mar 2024 12:46:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-109366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=Gdbz4OBe; arc=pass (i=1 spf=pass spfdomain=flex--yosryahmed.bounces.google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-109366-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-109366-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B58FD1C20E0E for ; Wed, 20 Mar 2024 19:46:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AA0AC85659; Wed, 20 Mar 2024 19:46:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Gdbz4OBe" Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 753325026C for ; Wed, 20 Mar 2024 19:46:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710964002; cv=none; b=nAwbVWWx8KXjyzAGN2MbRnYE34+eBcJPvxMpUBJjMpU2VnJZqAFaZK7jIlH7X/Z5Kn8jlhqg3dSE3DwI1RAX1Nh9qhMUno5RPVm4yiHp8W5bLR29grVZiWKdfgcM8w8bfM1A1AKtcnGzkwXbzoQYzgrULEVC1A8eriOfc7fI1Ms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710964002; c=relaxed/simple; bh=XrEzq6bloqFAKXeMdsNDdUP3x8FUbwhce87927qkd+w=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=N0MrqaYtKqSOEulzBfCrfaSeNDpTFtKnrooGqFL8sg9GSnoKVA/EGBDrEgH+mH/Y27OLenNMCmqbQmb3+j9ElmEwfPaYAj7MqrVuRIj+FMDSNBccCkptJ1h9aIU459sZbejeRtgTOBSZ3Owh3gn+30uod+vDD606m4kqDCo5A38= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=Gdbz4OBe; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--yosryahmed.bounces.google.com Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-608ad239f8fso2981057b3.0 for ; Wed, 20 Mar 2024 12:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1710964000; x=1711568800; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=XrEzq6bloqFAKXeMdsNDdUP3x8FUbwhce87927qkd+w=; b=Gdbz4OBe/Q4lt6LHkIGIg4Ii8mru77ms3HHeUJMvg3euKZGAdl1hG7HKlCbnreLdQw UDqwZPgBxSipXW+VQkZa3xrmpL7KtpVCv4es07MxJ0Z+CIeVkTkQ/fvJPdrqx6Kgw+iR JU2VV2MotjgIqHRcKQG1alrHC8rN/IbTfAH3l3fuKe8m8A7lb3JjrVNBTL/hmCyEAcPA +P0sWJMiuCw//R7Vr8hO343j+ig5efsVUiFz4DSYMd+eCaU7esIuJHwJz4U0x4kZCa3W bagHP0woTX+CGtioTEaCchect1mVGzdkq9EXGcwq5Q9LlEkIs41KBcihewnwHiANJsTq AZbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710964000; x=1711568800; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=XrEzq6bloqFAKXeMdsNDdUP3x8FUbwhce87927qkd+w=; b=hp5mIy0DxLlOi6qICB7JS2jkxeaGE23FipURSIOBRojPvEd2ERugwIpLfSDzEp+8el qPiPn8BNcOtcQQjO2F3EjH2LT19pecDMmTGG1PmuoXjo/lfLKsZfo8n8zMM+xGif+/T2 tx/nSnjuT+ZEqzmD8Q/4hDfy84T8H8GNA/OoCr8hhnVbIMo9NzpxnmgfigkOlloQqNNn /uT6yqliTQu27J+0hbGf9Tw4ZjV26Hefb6I9Fbr0roo9q+LgM+MmMq97Q3djB5QE/ml8 qnJqhQLpbP5+41h03AERghC5YSLLwHydUJu9ErjDFkwedfcb1m57QeNpz6Y4sYYJ1XFK wFnQ== X-Forwarded-Encrypted: i=1; AJvYcCU7H+PL8XsMISH/ouDbYfVMdlgsAxUa/kfZLWD9LI6U3A6mjnU4vPa9s3mvDeep7rcZHVBIwdai3njGL/1TU4919NefE9BrBrB2mQvR X-Gm-Message-State: AOJu0Ywof9TBHfA1pbBkLTvVhcYFT5Mpc/eqfEDXU4vlXtYP1S2S80jZ P0vx7XsZvRIAIUaTZmAQ4mv0RmjjDmEDp/TFNBYby2gkXWCEyQDzwWXZf182iO/Q5zQ+B9Wz/0Y aLyf/1X+/yzwLGIeUWA== X-Received: from yosry.c.googlers.com ([fda3:e722:ac3:cc00:20:ed76:c0a8:29b4]) (user=yosryahmed job=sendgmr) by 2002:a81:4847:0:b0:60a:16ae:38ee with SMTP id v68-20020a814847000000b0060a16ae38eemr4307414ywa.3.1710964000440; Wed, 20 Mar 2024 12:46:40 -0700 (PDT) Date: Wed, 20 Mar 2024 19:46:38 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20240319-zswap-xarray-v7-1-e9a03a049e86@kernel.org> <20240320100803.GB294822@cmpxchg.org> <20240320192558.GF294822@cmpxchg.org> Message-ID: Subject: Re: [PATCH v7] zswap: replace RB tree with xarray From: Yosry Ahmed To: Chris Li Cc: Johannes Weiner , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Nhat Pham , "Matthew Wilcox (Oracle)" , Chengming Zhou , Barry Song Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On Wed, Mar 20, 2024 at 12:41:48PM -0700, Chris Li wrote: > On Wed, Mar 20, 2024 at 12:34=E2=80=AFPM Yosry Ahmed wrote: > > > you can expect it to be coherent. > > > > Fair enough, but don't we still need a barrier there? Couldn't some > > initializations still be reorder after zswap_lru_add()? >=20 > I am under the impression that the lru list handling function already > handles the barrier. If an explicit barrier is needed, wouldn't all > other lru callers have barriers sprinkling all over the place? list_lru_add() holds a lock, which implies a compiler barrier. I was wondering if we need smp_wmb() to prevent other CPUs from observing a partially initialized entry during writeback. I am not sure if the list lru makes such assumptions about the need for barriers.