Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757764Ab2EIOAQ (ORCPT ); Wed, 9 May 2012 10:00:16 -0400 Received: from moutng.kundenserver.de ([212.227.126.187]:59320 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757182Ab2EIOAL (ORCPT ); Wed, 9 May 2012 10:00:11 -0400 From: Arnd Bergmann Organization: Linaro Limited To: Dave Chinner Subject: Re: [PATCH v2 01/16] FS: Added demand paging markers to filesystem Date: Wed, 9 May 2012 13:59:40 +0000 User-Agent: KMail/1.12.2 (Linux/3.4.0-rc3; KDE/4.3.2; x86_64; ; ) Cc: "S, Venkatraman" , linux-mmc@vger.kernel.org, cjb@laptop.org, linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, alex.lemberg@sandisk.com, ilan.smith@sandisk.com, lporzio@micron.com, rmk+kernel@arm.linux.org.uk References: <1336054995-22988-1-git-send-email-svenkatr@ti.com> <20120509003348.GM5091@dastard> In-Reply-To: <20120509003348.GM5091@dastard> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201205091359.40554.arnd.bergmann@linaro.org> X-Provags-ID: V02:K0:WTjuwwrqY6qs5R8yKyMuxkMyusXA+tuxezfXRWnxw8N 0wiTW2aAmdJ4bqh6si49AdphsZ7IfIKFS/uGOc9bb2qyNhmuGb e4dYE9K9aiYJK2pA3FcA6jnUk+jGEipasy1YcesFFMWj8Br63z wlLmvQbXjre7fSlUPczSaOeBjrlcHMjOZD15nASBB/KlAigVVt C59ui+oq7j+fgXaZg6gCWim2Bqe+Bb0DSbzP8f1Ks66qWAVfXd Lyqm9M3lqjK3cVnTVoqL7YPkXmUdJUrzAp+29mzSsjpynBNoqc W9g3vxN+jrZOQltNDhB5NYIhrY+L0+gU1KESHR4fWOO5df6ktl P9meTHs4i4jjp56GwBqRcpmZu8A5bntiv3sb3h7Ml Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2543 Lines: 52 On Wednesday 09 May 2012, Dave Chinner wrote: > > In low end flash devices, some requests might take too long than normal > > due to background device maintenance (i.e flash erase / reclaim procedure) > > kicking in in the context of an ongoing write, stalling them by several > > orders of magnitude. > > And thereby stalling what might be writes critical to operation. > Indeed, how does this affect the system when it starts swapping > heavily? If you keep stalling writes, the system won't be able to > swap and free memory... The point here is that reads have a consistent latency, e.g. 500 microseconds for a small access, while writes have a latency that can easily become 1000x the read latency (e.g. 500 ms of blocking the device) depending on the state of the device. Most of the time, writes are fast as well, but sometimes (when garbage collection happens in the device), they are extremely slow and block everything else. This is the only time we ever want to interrupt a write: keeping the system running interactively while eventually getting to do the writeback. There is a small penalty for interrupting the garbage collection, but the device should be able to pick up its work at the point where we interrupt it, so we can still make forward progress. > > > This really seems like functionality that belongs in an IO > > > scheduler so that write starvation can be avoided, not in high-level > > > data read paths where we have no clue about anything else going on > > > in the IO subsystem.... > > > > Indeed, the feature is built mostly in the low level device driver and > > minor changes in the elevator. Changes above the block layer are only > > about setting > > attributes and transparent to their operation. > > The problem is that the attribute you are setting covers every > single data read that is done by all users. If that's what you want > to have happen, then why do you even need a new flag at this layer? > Just treat every non-REQ_META read request as a demand paged IO and > you've got exactly the same behaviour without needing to tag at the > higher layer.... My feeling is that we should just treat every (REQ_SYNC | REQ_READ) request the same and let them interrupt long-running writes, independent of whether it's REQ_META or demand paging. Arnd -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/