All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Liang Chen <liangchen.linux@gmail.com>
Cc: colyli@suse.de, kent.overstreet@gmail.com,
	linux-kernel@vger.kernel.org, linux-bcache@vger.kernel.org
Subject: Re: [PATCH 2/2] [PATCH] bcache: __write_super to handle page sizes other than 4k
Date: Fri, 6 Dec 2019 01:23:36 -0800	[thread overview]
Message-ID: <20191206092336.GA7650@infradead.org> (raw)
In-Reply-To: <1575622543-22470-2-git-send-email-liangchen.linux@gmail.com>

On Fri, Dec 06, 2019 at 04:55:43PM +0800, Liang Chen wrote:
> __write_super assumes super block data starts at offset 0 of the page
> read in with __bread from read_super, which is not true when page size
> is not 4k. We encountered the issue on system with 64K page size - commonly
>  seen on aarch64 architecture.
> 
> Instead of making any assumption on the offset of the data within the page,
> this patch calls __bread again to locate the data. That should not introduce
> an extra io since the page has been held when it's read in from read_super,
> and __write_super is not on performance critical code path.

No need to use buffer heads here, you can just use offset_in_page
to calculate the offset.  Similarly I think the read side shouldn't
use buffer heads either (it is the only use of buffer heads in bcache!),
a siple read_cache_page should be all that is needed.

  reply	other threads:[~2019-12-06  9:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06  8:55 [PATCH 1/2] [PATCH] bcache: cached_dev_free needs to put the sb page Liang Chen
2019-12-06  8:55 ` [PATCH 2/2] [PATCH] bcache: __write_super to handle page sizes other than 4k Liang Chen
2019-12-06  9:23   ` Christoph Hellwig [this message]
2019-12-06 11:23     ` Liang C
2019-12-06  9:44   ` Coly Li
2019-12-06 11:22     ` Liang C
2019-12-09  7:37     ` Christoph Hellwig
2019-12-09  9:52       ` Coly Li
2019-12-09 10:21         ` Liang C
2019-12-06  9:27 ` [PATCH 1/2] [PATCH] bcache: cached_dev_free needs to put the sb page Christoph Hellwig
2019-12-06 11:27   ` Liang C
2019-12-06  9:42 ` Coly Li
2019-12-06 23:08 ` Eric Wheeler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191206092336.GA7650@infradead.org \
    --to=hch@infradead.org \
    --cc=colyli@suse.de \
    --cc=kent.overstreet@gmail.com \
    --cc=liangchen.linux@gmail.com \
    --cc=linux-bcache@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.