DriverDev-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Gao Xiang <gaoxiang25@huawei.com>
Cc: devel@driverdev.osuosl.org, Chao Yu <chao@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Miao Xie <miaoxie@huawei.com>, Chao Yu <yuchao0@huawei.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	weidu.du@huawei.com, Fang Wei <fangwei1@huawei.com>,
	Joe Perches <joe@perches.com>,
	linux-erofs@lists.ozlabs.org,
	Dan Carpenter <dan.carpenter@oracle.com>
Subject: Re: [PATCH v3 7/7] erofs: redundant assignment in __erofs_get_meta_page()
Date: Fri, 30 Aug 2019 09:28:12 -0700
Message-ID: <20190830162812.GA10694@infradead.org> (raw)
In-Reply-To: <20190830033643.51019-7-gaoxiang25@huawei.com>

> -		err = bio_add_page(bio, page, PAGE_SIZE, 0);
> -		if (err != PAGE_SIZE) {
> +		if (bio_add_page(bio, page, PAGE_SIZE, 0) != PAGE_SIZE) {
>  			err = -EFAULT;
>  			goto err_out;
>  		}

This patch looks like an improvement.  But looking at that whole
area just makes me cringe.

Why is there __erofs_get_meta_page with the two weird booleans instead
of a single erofs_get_meta_page that gets and gfp_t for additional
flags and an unsigned int for additional bio op flags.

Why do need ioprio support to start with?  Seeing that in a new
fs look kinda odd.  Do you have benchmarks that show the difference?

That function then calls erofs_grab_bio, which tries to handle a
bio_alloc failure, except that the function will not actually fail
due the mempool backing it.  It also seems like and awfully
huge function to inline.

Why is there __submit_bio which really just obsfucates what is
going on?  Also why is __submit_bio using bio_set_op_attrs instead
of opencode it as the comment right next to it asks you to?

Also I really don't understand why you can't just use read_cache_page
or even read_cache_page_gfp instead of __erofs_get_meta_page.
That function is a whole lot of duplication of functionality shared
by a lot of other file systems.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

  parent reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190830032006.GA20217@architecture4>
     [not found] ` <20190830033643.51019-1-gaoxiang25@huawei.com>
2019-08-30 15:25   ` [PATCH v3 1/7] erofs: on-disk format should have explicitly assigned numbers Gao Xiang
     [not found]   ` <20190830033643.51019-6-gaoxiang25@huawei.com>
2019-08-30 15:46     ` [PATCH v3 6/7] erofs: remove all likely/unlikely annotations Christoph Hellwig
2019-08-30 16:04       ` Gao Xiang
2019-08-31 10:57         ` Dan Carpenter
     [not found]   ` <20190830033643.51019-7-gaoxiang25@huawei.com>
2019-08-30 16:28     ` Christoph Hellwig [this message]
2019-08-30 16:48       ` [PATCH v3 7/7] erofs: redundant assignment in __erofs_get_meta_page() Gao Xiang

Reply instructions:

You may reply publically 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=20190830162812.GA10694@infradead.org \
    --to=hch@infradead.org \
    --cc=chao@kernel.org \
    --cc=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=fangwei1@huawei.com \
    --cc=gaoxiang25@huawei.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=joe@perches.com \
    --cc=linux-erofs@lists.ozlabs.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miaoxie@huawei.com \
    --cc=weidu.du@huawei.com \
    --cc=yuchao0@huawei.com \
    /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

DriverDev-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/driverdev-devel/0 driverdev-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 driverdev-devel driverdev-devel/ https://lore.kernel.org/driverdev-devel \
		driverdev-devel@linuxdriverproject.org devel@driverdev.osuosl.org
	public-inbox-index driverdev-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.linuxdriverproject.driverdev-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git