lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171019233731.GD27130@ming.t460p>
Date:   Fri, 20 Oct 2017 07:37:32 +0800
From:   Ming Lei <ming.lei@...hat.com>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     Jens Axboe <axboe@...com>, Huang Ying <ying.huang@...el.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Alexander Viro <viro@...iv.linux.org.uk>,
        linux-kernel@...r.kernel.org, linux-block@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH v3 20/49] block: introduce bio_for_each_segment_mp()

On Thu, Aug 10, 2017 at 05:11:10AM -0700, Christoph Hellwig wrote:
> First: as mentioned in the previous patches I really hate the name
> scheme with the _sp and _mp postfixes.
> 
> To be clear and understandable we should always name the versions
> that iterate over segments *segment* and the ones that iterate over
> pages *page*.  To make sure we have a clean compile break for code
> using the old _segment name I'd suggest to move to pass the bvec_iter
> argument by reference, which is the right thing to do anyway.

The most confusing thing is that bio_for_each_segment() and
bio_for_each_segment_all() has been used to iterate pages for long time.
That is why I add _sp/_mp in this patchset to make the uses explicitly
and avoid to confuse people.

My plan is to switch to the real bio_for_each_segment() for iterating
real segment and bio_for_each_page() for iterating page after we reach
mutlipage bvec, and that is basically a mechanical change.

> As far as the implementation goes I don't think we actually need
> to pass the mp argument down.  Instead we always call the full-segment
> version of  bvec_iter_len / __bvec_iter_advance and then have an
> inner loop that moves the fake bvecs forward inside each full-segment
> one - that is implement the per-page version on top of the per-segment
> one.

For iterating in way of real segment(multipage bvec) instead of page, we
don't need the inner loop for moving page by page to the fake bvec, that
is why the 'mp' argument is introduced. If this argument is dropped, we
have to find another similar way to decide to fetch one segment or one
page each time.

-- 
Ming

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ