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: <Zhavr9NxvayDhU9X@li-2b55cdcc-350b-11b2-a85c-a78bff51fc11.ibm.com>
Date: Wed, 10 Apr 2024 17:26:39 +0200
From: Sumanth Korikkar <sumanthk@...ux.ibm.com>
To: David Hildenbrand <david@...hat.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org, hughd@...gle.com,
        hca@...ux.ibm.com, gor@...ux.ibm.com, agordeev@...ux.ibm.com,
        iii@...ux.ibm.com, linux-s390@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/shmem: Inline shmem_is_huge() for disabled
 transparent hugepages

On Wed, Apr 10, 2024 at 02:34:35PM +0200, David Hildenbrand wrote:
> On 09.04.24 17:54, Sumanth Korikkar wrote:
> > In order to  minimize code size (CONFIG_CC_OPTIMIZE_FOR_SIZE=y),
> > compiler might choose to make a regular function call (out-of-line) for
> > shmem_is_huge() instead of inlining it. When transparent hugepages are
> > disabled (CONFIG_TRANSPARENT_HUGEPAGE=n), it can cause compilation
> > error.
> > 
> > mm/shmem.c: In function ‘shmem_getattr’:
> > ./include/linux/huge_mm.h:383:27: note: in expansion of macro ‘BUILD_BUG’
> >    383 | #define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
> >        |                           ^~~~~~~~~
> > mm/shmem.c:1148:33: note: in expansion of macro ‘HPAGE_PMD_SIZE’
> >   1148 |                 stat->blksize = HPAGE_PMD_SIZE;
> > 
> > To prevent the possible error, always inline shmem_is_huge() when
> > transparent hugepages are disabled.
> > 
> 
> Do you know which commit introduced that?
Hi David,

Currently with CONFIG_CC_OPTIMIZE_FOR_SIZE=y and expirementing with
-fPIC kernel compiler option, I could see this error on s390.

However, default kernel compiler options doesnt end up with the above
pattern right now.

I think, shmem_is_huge() for disabled transparent hugepages comes from:
Commit 5e6e5a12a44c ("huge tmpfs: shmem_is_huge(vma, inode, index)")

However, HPAGE_PMD_SIZE macros for !CONFIG_TRANSPARENT_HUGEPAGE
originates from:
Commit d8c37c480678 ("thp: add HPAGE_PMD_* definitions for
!CONFIG_TRANSPARENT_HUGEPAGE")

Thanks,
Sumanth

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ