From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 901CF14B959 for ; Wed, 15 Jan 2025 23:28:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736983718; cv=none; b=feAM9ok1IZiuoBEcziOEsAnJ/vaH6QIWp7n73H8FWck/cdU01zeHMKIxJAM7DvHVQQ0CxKGXZ0rTd9Fi/B2AS1aCgDQSQ1lkP7udIti6J/NBoISuM5mEgG9aPHvUXuQrMqHQXWAgtvlT85D7nl9EU7vh561yzyLI8XIXslObufU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736983718; c=relaxed/simple; bh=kDfcMpdpjZxfdtKb7Tp08GotUeCqXiX7sfAnuuPns1c=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=V8D4WBrfr/YyxsitWo6S0DbkejgFut+jtPpTUnxN63ynNw4mb8VpsRy54umjN4+aucrPddJ1Rj87NbxnO2OyXRNre19zb5BM2yZNjvfQW0XXAjq0b0kltIIi4VEigHQfSZ6LxtslD+EpSATpysnfK7w2LK6jVScKvdl+jzPRhD8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=I/pa/+OL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="I/pa/+OL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E8D12C4CED1; Wed, 15 Jan 2025 23:28:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1736983718; bh=kDfcMpdpjZxfdtKb7Tp08GotUeCqXiX7sfAnuuPns1c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=I/pa/+OLT3zlX7TPjvt4aw00WltnE2BG/TUHtUs+6NR6dj16hENhqIvL3/WUueF+N tnSwurppzG8ycTWQREOZkDKoLU8GcciqGh6/e6/LrNL6YZHKk+HVLPUxWjd2/OD9Xi kluUWpAN+WZyV0LC5jgUTzMb0g6Ma0P9UPqEWOtU= Date: Wed, 15 Jan 2025 15:28:37 -0800 From: Andrew Morton To: Sergey Senozhatsky Cc: Minchan Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] zram: remove zcomp_stream_put() from write_incompressible_page() Message-Id: <20250115152837.b9f721bccfd07ce903fc4539@linux-foundation.org> In-Reply-To: <20250115072003.380567-1-senozhatsky@chromium.org> References: <20250115072003.380567-1-senozhatsky@chromium.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 15 Jan 2025 16:19:16 +0900 Sergey Senozhatsky wrote: > We cannot and should not put per-CPU compression stream in > write_incompressible_page() because that function never gets any > per-CPU streams in the first place. It's zram_write_page() that > puts the stream before it calls write_incompressible_page(). > > ... > > +++ b/drivers/block/zram/zram_drv.c > @@ -1683,7 +1683,6 @@ static int write_incompressible_page(struct zram *zram, struct page *page, > return PTR_ERR((void *)handle); > > if (!zram_can_store_page(zram)) { > - zcomp_stream_put(zram->comps[ZRAM_PRIMARY_COMP]); > zs_free(zram->mem_pool, handle); > return -ENOMEM; > } I added Fixes: 485d11509d6d ("zram: factor out ZRAM_HUGE write") That way, anyone who backports 485d11509d6d into their earlier kernel will have a better chance of noticing that they need this fixup.