From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f173.google.com (mail-dy1-f173.google.com [74.125.82.173]) (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 095B734F244 for ; Sat, 14 Mar 2026 05:18:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773465505; cv=none; b=e1eN7CNFH1PmIqNdHdkXBpVYMN4rJllQrTkhe5oWcMge1AYbrZUc/BL7GfG69XKFBa1MdndVs/B6v8gGEKyL3p54c2Cfr9HbKyMxwnhj5o6imnR01B8Ti/FInhloPDhEketZ3FazzFhrKohhHacvYshOuVOgoACoKlHgBCykkFw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773465505; c=relaxed/simple; bh=cD0h79bcuer34NLlHMZE/oGaN/13PeNV8/kE5uFCpbo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=UYbGY7bTVlJ7V14g6wuKnSoTAoy7xeIflBfpU+6gvRWU4jxSgVehrEqZc5SJEED0q3pAsmej8wRAA57thMn2vI3OPHgKScc4cc2wmxr1VFmmgYOimgArkfaBoyz2UfRML+wijclu0cDMWBuGLU+mcmgrgtBGUP0SMOm0DS+fruA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LKKwfBmd; arc=none smtp.client-ip=74.125.82.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LKKwfBmd" Received: by mail-dy1-f173.google.com with SMTP id 5a478bee46e88-2b6b0500e06so3432177eec.1 for ; Fri, 13 Mar 2026 22:18:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773465503; x=1774070303; darn=vger.kernel.org; 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=C2XHqajDXsgyk0pau5z/RmGDX7ZGwwu7itA1VuqFfAc=; b=LKKwfBmdRxHZHzlceCMR1DLmbQXRn8XLrw6gUoHHbCTjAYPXiv/r/OGd/8O7RgmCUj bf8trzhXkhk2mlFZ1b9blrW35mvjocMNkDY/dbKgr9f3wb8VYqfVxQlskriuFnY7Jf5h LVBReALC21km/wrHqKD5Q9PI4MuMFkHHWX+QGxjGAbIxPtbCiduEllBNW970WZwmWOJ8 MmAJbuCxnc24avNdJCN/Tj15+rFpJ0pA4gUB11RjYL+piG6A/j9/fuk9/rR8ptxOKCJL 3aKES2MDT3pjVnocmL6qhDlFwLKOMh3l6j43DPbHJot+JDRJsEEpYLK7pLaAeZ/46WTD rrFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773465503; x=1774070303; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=C2XHqajDXsgyk0pau5z/RmGDX7ZGwwu7itA1VuqFfAc=; b=i6wFIDgwww7H9AWMWj/shHiPJwfa5cKFebjv6vFhRSdiPVZnxh6E2YIIoxgRAINAZm lHO6Xd+oJrImCFQx7M8fvrrhZhVx9qTJpotCbG34DJnrPXeksFRatIoSC3SS+cWGh9eu h51/97ovnB8RG1guh/gR4OKTo0tXSds4CbT76hcj687YhUaLe+tIMmSD0REwQP8oz9X8 r7kYyfR1xpgeOUrPSNFqN5idKTi9k2eJaum7CjWEPH9XycpashyghYZGEOSl1C8MOxpS C9L98OxJ1kXQ7cBXS5IlnJOZSG8pOcVatt7ZyVogQSCcYxNna4uP+hWutuPmt0d1m4hv 1b9A== X-Forwarded-Encrypted: i=1; AJvYcCVQq1bCr4zx3EiFnUQeWm6Mp29CsXbqQya1LDEtZOSPOyZfJSZKrHJANl23lcagwUFRyjLcFDjQkvAipwM=@vger.kernel.org X-Gm-Message-State: AOJu0Yz7pFzB/HRpSVM2W1lC8K5DkNef4CBGhclqk1oG0x/mSdVUP8ZS B3xeCHFR1ldf/q1V2OjmS8RaC0nHDUS0G0lnAn8bOjYKExWQndYkNjrF X-Gm-Gg: ATEYQzyLcrD/SgxTyzZmXS0Kpq5eoihdz1HaGmizJmW0PLO/Dru/cXznFRJ2aT6s3h2 NNmTliXKhbjEVwxIOdHfUko5Xq7hZQnn2M/S8RPegbv3wwJcw5Z/JhPvQtVrN+gZ2z5I6A+po27 9auJxMvq2nNJ1pImMHv11/FXnr0oy4hmOnqodTmMToPbtXKdF5lCnyaMaFdSMIUqjufJOeNzwlO Vc4fwZYaeWi4KTpSLIE+xuz/ifre50WqhgU1s8UhHxuv35lZdy+Mf6qtRFFe3H+2uzdmbArKCp9 y3VLsWuJDRadqJZxcAjTDJTiXm+zikMegDXUJwjoGBxKLOEFqyYNTvcuUoXnLVwHxVufcoX2TPO bE0tNZAWj+PlMX/uY2OhG4iQsI8Q1g5jKCg2DE1YQTJOEXfDqVVpjsv/e6JKbpY6w7pM718R+7/ D2hkpa9etae4P7Ibw/ufYqwPY= X-Received: by 2002:a05:7300:7303:b0:2be:6a7:d54e with SMTP id 5a478bee46e88-2bea53fa143mr2507060eec.14.1773465502924; Fri, 13 Mar 2026 22:18:22 -0700 (PDT) Received: from penguin.lxd ([2601:647:6400:3ec0:216:3eff:fecd:e4ef]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2beab57b1d2sm5303069eec.32.2026.03.13.22.18.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 22:18:22 -0700 (PDT) From: "Kanchana P. Sridhar" To: hannes@cmpxchg.org, yosry@kernel.org, nphamcs@gmail.com, chengming.zhou@linux.dev, akpm@linux-foundation.org, kanchanapsridhar2026@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: herbert@gondor.apana.org.au, senozhatsky@chromium.org Subject: Re: [PATCH v14 23/26] mm: zswap: Tie per-CPU acomp_ctx lifetime to the pool. Date: Fri, 13 Mar 2026 22:18:09 -0700 Message-Id: <20260314051809.17960-1-kanchanapsridhar2026@gmail.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20260125033537.334628-24-kanchana.p.sridhar@intel.com> References: <20260125033537.334628-24-kanchana.p.sridhar@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Wed, 4 Feb 2026 16:29:35 +0000, Yosry Ahmed wrote: [...] > LGTM with a small nit below: > > Acked-by: Yosry Ahmed > Thanks! [...] > > +static void acomp_ctx_dealloc(struct crypto_acomp_ctx *acomp_ctx) > > +{ > > + if (IS_ERR_OR_NULL(acomp_ctx)) > > + return; > > + > > + if (!IS_ERR_OR_NULL(acomp_ctx->req)) > > + acomp_request_free(acomp_ctx->req); > > + > > + if (!IS_ERR_OR_NULL(acomp_ctx->acomp)) > > + crypto_free_acomp(acomp_ctx->acomp); > > Should we set acomp_ctx->req, acomp_ctx->acomp, and acomp_ctx->buffer to > NULL here? > > zswap_cpu_comp_prepare() uses NULL to detect that we need to initialize > acomp_ctx. > I don't think this is needed, because with the changes made in this patch, there is no scenario in which zswap_cpu_comp_prepare() will be called *after* acomp_ctx_dealloc() deletes these resources. zswap_cpu_comp_prepare() is called only during pool creation or after a subsequent CPU hotplug operation (for a CPU getting onlined when it was offline at pool creation time, or, due to an offline-online transition of a CPU that was online at pool creation time). In both these cases, the per-CPU acomp_ctx members are either NULL or valid. Thanks, Kanchana > > + > > + kfree(acomp_ctx->buffer); > > +} > > +