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: <20240903022902.GP9627@mit.edu>
Date: Mon, 2 Sep 2024 22:29:02 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: "zhaoyang.huang" <zhaoyang.huang@...soc.com>
Cc: Andreas Dilger <adilger.kernel@...ger.ca>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        linux-fsdevel@...r.kernel.org, linux-ext4@...r.kernel.org,
        Zhaoyang Huang <huangzhaoyang@...il.com>, steve.kang@...soc.com
Subject: Re: [RFC PATCHv2 1/1] fs: ext4: Don't use CMA for buffer_head

On Fri, Aug 23, 2024 at 04:22:37PM +0800, zhaoyang.huang wrote:
>  
> +#ifndef CONFIG_CMA
>  	bh = sb_getblk(inode->i_sb, map.m_pblk);
> +#else
> +	bh = sb_getblk_gfp(inode->i_sb, map.m_pblk, 0);
> +#endif

So all of these patches to try to work around your issue with CMA are
a bit ugly.  But passing in a GFP mask of zero is definitely not the
right way to go about thing, since there might be certain GFP masks
that are required by a particular block device.  What I think you are
trying to do is to avoid setting the __GFP_MOVEABLE flag.  So in that
case, in the CMA path something like this is what you want:

	bh = getblk_unmoveable(sb->s_bdev, map.m_pblk, sb->s_blocksize);

I'd also sugest only trying to use this is the file system has
journaling enabled.  If the file system is an ext2 file system without
a journal, there's no reason avoid using the CMA region --- and I
assume the reason why the buffer cache is trying to use the moveable
flag is because the amount of non-CMA memory might be a precious
resource in some systems.

				- Ted

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ