Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932618AbcKWEoE (ORCPT ); Tue, 22 Nov 2016 23:44:04 -0500 Received: from mail-pg0-f42.google.com ([74.125.83.42]:36636 "EHLO mail-pg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752746AbcKWEoD (ORCPT ); Tue, 22 Nov 2016 23:44:03 -0500 Date: Tue, 22 Nov 2016 20:43:54 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Minchan Kim cc: Hugh Dickins , Andrew Morton , "Darrick J . Wong" , Hyeoncheol Lee , yjay.kim@lge.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH v2] mm: support anonymous stable page In-Reply-To: <20161122044322.GA2864@bbox> Message-ID: References: <20161120233015.GA14113@bbox> <20161122044322.GA2864@bbox> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1320 Lines: 30 On Tue, 22 Nov 2016, Minchan Kim wrote: > On Mon, Nov 21, 2016 at 07:46:28PM -0800, Hugh Dickins wrote: > > > > Andrew might ask if we should Cc stable (haha): I think we agree > > that it's a defect we've been aware of ever since stable pages were > > first proposed, but nobody has actually been troubled by it before > > your async zram development: so, you're right to be fixing it ahead > > of your zram changes, but we don't see a call for backporting. > > I thought so until I see your comment. However, I checked again > and found it seems a ancient bug since zram birth. > swap_writepage unlock the page right before submitting bio while > it keeps the lock during rw_page operation during bdev_write_page. > So, if zram_rw_page fails(e.g, -ENOMEM) and then fallback to > submit_bio in __swap_writepage, the problem can occur. It's not clear to me why that matters. If it drives zram mad to the point of crashing the kernel, yes, that would matter. But if it just places incomprehensible or mis-CRCed data on the device, who cares? The reused swap page is marked dirty, and nobody should be reading the stale data back off swap. If you do resend with a stable tag, please make clear why it matters. Hugh > > Hmm, I will resend patchset with zram fix part with marking > the stable. > > Thanks, Hugh!