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 A59131A76D2 for ; Fri, 6 Dec 2024 10:15:33 +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=1733480133; cv=none; b=rX4fOPJ+qh8DaRpDlFWSl1KvfJZvCpZM5NqMkoZuibOdH+TZYj9ZNWbfuLa+RpSinGYjbkrfleinOwLNoplTdRNz+wshzvHqVEkkj0Wzx4n9u+FGq1Q/GB0DQDdnJkDq7pvYOjGCaiROatvhBbJbAoUTCBrHyg3CSAIpoVKsBHE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733480133; c=relaxed/simple; bh=c4WEJmLTfKpKZg3aMWOnNt5UE3mZIE2KSlMSyk9/JJs=; h=Subject:To:Cc:From:Date:Message-ID:MIME-Version:Content-Type; b=DC5UCvLN/HMH0KYQQUxs46eL3bLnG9TsUiCYNaGQtCCK4hawdlhP3aXlp3/mJ8F1+URmwv85xjdvgRzGbRABdfPEKv3eH7RcP8IYd+meqQJ5MrQBzCdVOJYM/R6UZZnhZnPq0WDNvekaars6YcSJoz6wDIvA1rY8RhlpZzdUurE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=K6812v2w; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="K6812v2w" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BB6C6C4CED1; Fri, 6 Dec 2024 10:15:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1733480133; bh=c4WEJmLTfKpKZg3aMWOnNt5UE3mZIE2KSlMSyk9/JJs=; h=Subject:To:Cc:From:Date:From; b=K6812v2wK9hLZCIz7F4mlV4PT8dVE4jfiAN7v2MG2MsD3zIx3eFXi3c02DxhlKKx9 hPtrbse/3HlW7F2LKMeFkHGI2D2M8TCHA4HKuZMecLe2Ngwi4oJaTCdyr0NqlAdE+y rDuHYhyMJq1YA4zeLEUTK1/vxLKCbDCsGKavVxoU= Subject: FAILED: patch "[PATCH] zram: clear IDLE flag in mark_idle()" failed to apply to 6.1-stable tree To: senozhatsky@chromium.org,akpm@linux-foundation.org,bgeffon@google.com,kawasin@google.com,minchan@kernel.org,stable@vger.kernel.org Cc: From: Date: Fri, 06 Dec 2024 11:15:22 +0100 Message-ID: <2024120622-entryway-geologic-5d23@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . To reproduce the conflict and resubmit, you may use the following commands: git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.1.y git checkout FETCH_HEAD git cherry-pick -x d37da422edb0664a2037e6d7d42fe6d339aae78a # git commit -s git send-email --to '' --in-reply-to '2024120622-entryway-geologic-5d23@gregkh' --subject-prefix 'PATCH 6.1.y' HEAD^.. Possible dependencies: thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From d37da422edb0664a2037e6d7d42fe6d339aae78a Mon Sep 17 00:00:00 2001 From: Sergey Senozhatsky Date: Tue, 29 Oct 2024 00:36:15 +0900 Subject: [PATCH] zram: clear IDLE flag in mark_idle() If entry does not fulfill current mark_idle() parameters, e.g. cutoff time, then we should clear its ZRAM_IDLE from previous mark_idle() invocations. Consider the following case: - mark_idle() cutoff time 8h - mark_idle() cutoff time 4h - writeback() idle - will writeback entries with cutoff time 8h, while it should only pick entries with cutoff time 4h The bug was reported by Shin Kawamura. Link: https://lkml.kernel.org/r/20241028153629.1479791-3-senozhatsky@chromium.org Fixes: 755804d16965 ("zram: introduce an aged idle interface") Signed-off-by: Sergey Senozhatsky Reported-by: Shin Kawamura Acked-by: Brian Geffon Cc: Minchan Kim Signed-off-by: Andrew Morton Cc: diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index a16dbffcdca3..cee49bb0126d 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -410,6 +410,8 @@ static void mark_idle(struct zram *zram, ktime_t cutoff) #endif if (is_idle) zram_set_flag(zram, index, ZRAM_IDLE); + else + zram_clear_flag(zram, index, ZRAM_IDLE); zram_slot_unlock(zram, index); } }