From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424AbcELUaL (ORCPT ); Thu, 12 May 2016 16:30:11 -0400 Received: from plane.gmane.org ([80.91.229.3]:53261 "EHLO plane.gmane.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751167AbcELUaH (ORCPT ); Thu, 12 May 2016 16:30:07 -0400 X-Injected-Via-Gmane: http://gmane.org/ To: linux-kernel@vger.kernel.org From: gwendal grignou Subject: Re: [PATCH] loop: properly observe rotational flag of underlying device Date: Thu, 12 May 2016 20:28:34 +0000 (UTC) Message-ID: References: <56435D0F.80006@googlemail.com> <5643B341.9010600@fb.com> <5643BC5E.8060701@googlemail.com> <569438BB.6050009@googlemail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 104.132.1.82 (Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.75 Safari/537.36) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id u4CKUG0h000762 Holger Hoffstätte googlemail.com> writes: > > On 11/11/15 23:08, Holger Hoffstätte wrote: > > On 11/11/15 22:29, Jens Axboe wrote: > >> On 11/11/2015 08:21 AM, Holger Hoffstätte wrote: > >>> > >>> The loop driver always declares the rotational flag of its device as > >>> rotational, even when the device of the mapped file is nonrotational, > >>> as is the case with SSDs or on tmpfs. This can confuse filesystem tools > >>> which are SSD-aware; in my case I frequently forget to tell mkfs.btrfs > >>> that my loop device on tmpfs is nonrotational, and that I really don't > >>> need any automatic metadata redundancy. > >>> > >>> The attached patch fixes this by introspecting the rotational flag of the > >>> mapped file's underlying block device, if it exists. If the mapped file's > >>> filesystem has no associated block device - as is the case on e.g. tmpfs - > >>> we assume nonrotational storage. If there is a better way to identify such > >>> non-devices I'd love to hear them. > >>> > >>> Signed-off-by: Holger Hoffstätte googlemail.com> > > Jens, > > I haven't seen this merged in any trees yet and was wondering if there's > any chance to get this into 4.5? If there's something left to fix up please > let me know. > > Thanks, > Holger > > This patch proved useful for ureadahead: when we use it on a loop device, it would use the HDD method to place the data in cache using the pack information instead of the SSD method. Signed-off-by: Gwendal Grignou