Received: by 2002:ac0:8c8e:0:0:0:0:0 with SMTP id r14csp129063ima; Wed, 6 Feb 2019 18:41:21 -0800 (PST) X-Google-Smtp-Source: AHgI3Ib4Mfd2bUkaGSqDqQW4ho0eQuhegapHABgKePMU/06bLHWIeerxjKGR3DSiThYm13+2DuLb X-Received: by 2002:a17:902:33c1:: with SMTP id b59mr13972888plc.220.1549507281775; Wed, 06 Feb 2019 18:41:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549507281; cv=none; d=google.com; s=arc-20160816; b=MhBU85h0LO0L4QLzXqPqsIkWJNfxi4cIG9jA/ww3c2BnwAk82TELrhIcgW4yVFTwQX ydze/44f4lnSzxvyiEaPXiixFosekFXCO5qViXKhlAnRo7wRjkU+SAOR/wiGLg5PcbTR aMjVVLrv2cy7ft9Q1I7sYRltv7IjHSZcGlmJUfm+BmwSx1FuO0kjii8POVmr475FcGZl YLKYkk5qqtNQ6XN/6Qu0X5JRxB226qua1Z/9pNd0z+ecBhT1kGjUlRb0qccb2ba4MEYD XxyCzD9cqJOhY3m1zHO0866SjaTZKnT7o01nQrMrQuu+PNZGn13M20pTJvKCvEDHRC25 nZkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:openpgp:from:references:cc:to:subject; bh=+qV1e+gk+uftD/tI3ZPeoOzq6wgpgQ6sTXl4t0r9R6c=; b=L/dVDm20UFEFWyVWrC59u5xXs1WOhHGp7pfuSrN7z0jWAW458t34pjcOLBsMjKNG6z BB5cLU4J/8CFvrXvSKqOy9pwoSp4rc6hsBUg/SnvP77MlJff9logAog869cyWAu807c7 sUbJrwKu74iTGYBFrcQEGUk0w7xQWllw4+sjB/ACeA4Z5i/+sz34B2gXse3gmGER1ysy QfeCOs02Bb4+aJHu6iAwJIBJ60qWWDio9+SSUNZFESz58jfnfWJgtxtsVMI24k8R6To1 jg6OpjYyhy1XZWKTbFacS9I1tBwWK3zSXo/GtpyRFwVchzHg9sDqA3/T7PjRUo5njMEM o7Hw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e125si920732pgc.411.2019.02.06.18.41.06; Wed, 06 Feb 2019 18:41:21 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726782AbfBGCjJ (ORCPT + 99 others); Wed, 6 Feb 2019 21:39:09 -0500 Received: from mx2.suse.de ([195.135.220.15]:45290 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726245AbfBGCjI (ORCPT ); Wed, 6 Feb 2019 21:39:08 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 0407BAF0C; Thu, 7 Feb 2019 02:39:07 +0000 (UTC) Subject: Re: bcache on XFS: metadata I/O (dirent I/O?) not getting cached at all? To: Dave Chinner , Andre Noll Cc: Nix , linux-bcache@vger.kernel.org, linux-xfs@vger.kernel.org, linux-kernel@vger.kernel.org, Christoph Hellwig , axboe@kernel.dk References: <87h8dgefee.fsf@esperi.org.uk> <20190206234328.GH14116@dastard> <20190207002425.GX24140@tuebingen.mpg.de> <20190207022657.GI14116@dastard> From: Coly Li Openpgp: preference=signencrypt Organization: SUSE Labs Message-ID: <438851ef-ef77-b5f2-d46d-05762b6330b2@suse.de> Date: Thu, 7 Feb 2019 10:38:58 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190207022657.GI14116@dastard> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019/2/7 10:26 上午, Dave Chinner wrote: > On Thu, Feb 07, 2019 at 01:24:25AM +0100, Andre Noll wrote: >> On Thu, Feb 07, 10:43, Dave Chinner wrote >>> File data readahead: REQ_RAHEAD >>> Metadata readahead: REQ_META | REQ_RAHEAD >>> >>> drivers/md/bcache/request.c::check_should_bypass(): >>> >>> /* >>> * Flag for bypass if the IO is for read-ahead or background, >>> * unless the read-ahead request is for metadata (eg, for gfs2). >>> */ >>> if (bio->bi_opf & (REQ_RAHEAD|REQ_BACKGROUND) && >>> !(bio->bi_opf & REQ_PRIO)) >>> goto skip; >>> >>> bcache needs fixing - it thinks REQ_PRIO means metadata IO. That's >>> wrong - REQ_META means it's metadata IO, and so this is a bcache >>> bug. >> >> Do you think 752f66a75abad is bad (ha!) and should be reverted? > > Yes, that change is just broken. From include/linux/blk_types.h: > > __REQ_META, /* metadata io request */ > __REQ_PRIO, /* boost priority in cfq */ > > Hi Dave, > i.e. REQ_META means that it is a metadata request, REQ_PRIO means it > is a "high priority" request. Two completely different things, often > combined, but not interchangeable. I found in file system metadata IO, most of time REQ_META and REQ_PRIO are tagged together for bio, but XFS seems not use REQ_PRIO. Is there any basic principle for when should these tags to be used or not ? e.g. If REQ_META is enough for meta data I/O, why REQ_PRIO is used too. And if REQ_PRIO is necessary, why it is not used in fs/xfs/ code ? > > So, yeah, that needs to be reverted if you want bcache to function > properly for metadata caching. Sure, I will fix this, once I make it clear to me. Thanks for the hint. -- Coly Li