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: <20200923063243.GA17027@infradead.org>
Date:   Wed, 23 Sep 2020 07:32:43 +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 1/2] mm,swap: extract swap single page readahead into its
 own function

On Mon, Sep 21, 2020 at 10:01:47PM -0400, Rik van Riel wrote:
> +static struct page *swap_cluster_read_one(swp_entry_t entry,
> +		unsigned long offset, gfp_t gfp_mask,
> +		struct vm_area_struct *vma, unsigned long addr, bool readahead)
> +{
> +	bool page_allocated;
> +	struct page *page;
> +
> +	page =__read_swap_cache_async(swp_entry(swp_type(entry), offset),
> +				      gfp_mask, vma, addr, &page_allocated);

Missing whitespace after the "=".

> +	if (!page)
> +		return NULL;
> +	if (page_allocated) {
> +		swap_readpage(page, false);
> +		if (readahead) {
> +			SetPageReadahead(page);
> +			count_vm_event(SWAP_RA);
> +		}
> +	}
> +	put_page(page);
> +	return page;
> +}

I think swap_vma_readahead can be switched to your new helper
pretty trivially as well, as could many of the users of
read_swap_cache_async.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ