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: <ZQRKv6NcfYCr0aWo@casper.infradead.org>
Date:   Fri, 15 Sep 2023 13:14:55 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Daniel Gomez <da.gomez@...sung.com>
Cc:     "minchan@...nel.org" <minchan@...nel.org>,
        "senozhatsky@...omium.org" <senozhatsky@...omium.org>,
        "axboe@...nel.dk" <axboe@...nel.dk>,
        "djwong@...nel.org" <djwong@...nel.org>,
        "hughd@...gle.com" <hughd@...gle.com>,
        "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "mcgrof@...nel.org" <mcgrof@...nel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-xfs@...r.kernel.org" <linux-xfs@...r.kernel.org>,
        "linux-fsdevel@...r.kernel.org" <linux-fsdevel@...r.kernel.org>,
        "linux-mm@...ck.org" <linux-mm@...ck.org>,
        "gost.dev@...sung.com" <gost.dev@...sung.com>,
        Pankaj Raghav <p.raghav@...sung.com>
Subject: Re: [PATCH 3/6] shmem: account for large order folios

On Fri, Sep 15, 2023 at 09:51:26AM +0000, Daniel Gomez wrote:
> @@ -1810,13 +1815,14 @@ static void shmem_set_folio_swapin_error(struct inode *inode, pgoff_t index,
>  		return;
>  
>  	folio_wait_writeback(folio);
> +	num_swap_pages = folio_nr_pages(folio);
>  	delete_from_swap_cache(folio);
>  	/*
>  	 * Don't treat swapin error folio as alloced. Otherwise inode->i_blocks
>  	 * won't be 0 when inode is released and thus trigger WARN_ON(i_blocks)
>  	 * in shmem_evict_inode().
>  	 */
> -	shmem_recalc_inode(inode, -1, -1);
> +	shmem_recalc_inode(inode, num_swap_pages, num_swap_pages);

Shouldn't that be -num_swap_pages?

>  	swap_free(swap);
>  }
>  
> @@ -1903,7 +1909,7 @@ static int shmem_swapin_folio(struct inode *inode, pgoff_t index,
>  	if (error)
>  		goto failed;
>  
> -	shmem_recalc_inode(inode, 0, -1);
> +	shmem_recalc_inode(inode, 0, folio_nr_pages(folio));
>  
>  	if (sgp == SGP_WRITE)
>  		folio_mark_accessed(folio);

Also here.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ