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]
Date:   Wed, 23 Sep 2020 07:35:09 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Rik van Riel <riel@...riel.com>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        kernel-team@...com, niketa@...com, akpm@...ux-foundation.org,
        sjenning@...hat.com, ddstreet@...e.org, konrad.wilk@...cle.com,
        hannes@...xchg.org
Subject: Re: [PATCH 2/2] mm,swap: skip swap readahead if page was obtained
 instantaneously

On Mon, Sep 21, 2020 at 10:01:48PM -0400, Rik van Riel wrote:
> +	struct page *page;
>  	unsigned long entry_offset = swp_offset(entry);
>  	unsigned long offset = entry_offset;
>  	unsigned long start_offset, end_offset;
> @@ -668,11 +669,18 @@ struct page *swap_cluster_readahead(swp_entry_t entry, gfp_t gfp_mask,
>  		end_offset = si->max - 1;
>  
>  	blk_start_plug(&plug);
> +	/* If we read the page without waiting on IO, skip readahead. */
> +	page = swap_cluster_read_one(entry, offset, gfp_mask, vma, addr, false);
> +	if (page && PageUptodate(page))
> +		goto skip_unplug;
> +

At least for the normal block device path the plug will prevent the
I/O submission from actually happening and thus PageUptodate from
becoming true.  I think we need to split the different code paths
more cleanly.

Btw, what device type and media did you test this with?  What kind of
numbers did you get on what workload?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ