From patchwork Thu Jan 13 05:59:11 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Theodore Ts'o X-Patchwork-Id: 78660 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3B89AB70B3 for ; Thu, 13 Jan 2011 16:59:44 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750978Ab1AMF7P (ORCPT ); Thu, 13 Jan 2011 00:59:15 -0500 Received: from thunk.org ([69.25.196.29]:60410 "EHLO thunker.thunk.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751841Ab1AMF7O (ORCPT ); Thu, 13 Jan 2011 00:59:14 -0500 Received: from root (helo=tytso-glaptop) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1PdGDJ-0003uP-EN; Thu, 13 Jan 2011 00:59:13 -0500 Received: from tytso by tytso-glaptop with local (Exim 4.71) (envelope-from ) id 1PdGDH-0006oP-Js; Thu, 13 Jan 2011 00:59:11 -0500 From: Theodore Ts'o To: Ext4 Developers List Cc: Linux Kernel Developers List , Theodore Ts'o , Sebastian Ott , linux-pm@lists.linux-foundation.org Subject: [PATCH] PM / Hibernate: Don't mark pages dirty when reading pages while thawing Date: Thu, 13 Jan 2011 00:59:11 -0500 Message-Id: <1294898351-26156-1-git-send-email-tytso@mit.edu> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <20110113055612.GF13496@thunk.org> References: <20110113055612.GF13496@thunk.org> X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@thunk.org X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org Everything was sync'ed before the hibernation, so no pages could be dirty. So this causes a lot of wasted I/O activity right after resuming from hibernation. Worse, it also causes pages from files that were opened read/only to be marked writeble which makes them subject to writeback. This was discovered when ext4 was changed to so that the jinode pointer was not initialized unless the file was opened read/write, and this caused things to blow up. But that just unmasked a problem, since the pages belonging to the file in question should have never been marked dirty in the first place. It increases the chances the text blocks for executables like /usr/bin/killall will get corrupted when they are needlessly written, and of course it means extra write cycles to the SSD. Signed-off-by: "Theodore Ts'o" Cc: Sebastian Ott Cc: linux-pm@lists.linux-foundation.org --- kernel/power/block_io.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/kernel/power/block_io.c b/kernel/power/block_io.c index 83bbc7c..108a4f3 100644 --- a/kernel/power/block_io.c +++ b/kernel/power/block_io.c @@ -49,8 +49,6 @@ static int submit(int rw, struct block_device *bdev, sector_t sector, if (bio_chain == NULL) { submit_bio(bio_rw, bio); wait_on_page_locked(page); - if (rw == READ) - bio_set_pages_dirty(bio); bio_put(bio); } else { if (rw == READ)