Skip to content
This repository has been archived by the owner on Feb 26, 2020. It is now read-only.

Detect kernels that honor gfp flags passed to vmalloc() #126

Closed
wants to merge 1 commit into from

Conversation

ryao
Copy link
Contributor

@ryao ryao commented Jun 17, 2012

2092cf6 used PF_MEMALLOC
to workaround a bug in the Linux kernel where allocations did not honor
the gfp flags passed to vmalloc(). Unfortunately, PF_MEMALLOC has the
side effect of permitting allocations to allocate pages outside of
ZONE_NORMAL. This has been observed to result in the depletion of
ZONE_DMA32 on Gentoo Linux. A kernel patch is available in the Gentoo
bug tracker for this issue:

https://bugs.gentoo.org/show_bug.cgi?id=416685

This negates any benefit PF_MEMALLOC provides, so we introduce an
autotools check to disable the use of PF_MEMALLOC on systems with
patched kernels.

Signed-off-by: Richard Yao [email protected]

openzfs/spl@2092cf6 used PF_MEMALLOC
to workaround a bug in the Linux kernel where allocations did not honor
the gfp flags passed to vmalloc(). Unfortunately, PF_MEMALLOC has the
side effect of permitting allocations to allocate pages outside of
ZONE_NORMAL. This has been observed to result in the depletion of
ZONE_DMA32 on Gentoo Linux. A kernel patch is available in the Gentoo
bug tracker for this issue:

https://bugs.gentoo.org/show_bug.cgi?id=416685

This negates any benefit PF_MEMALLOC provides, so we introduce an
autotools check to disable the use of PF_MEMALLOC on systems with
patched kernels.

Signed-off-by: Richard Yao <[email protected]>
@behlendorf
Copy link
Contributor

Merged with a few minor modifications to the autotools test to silence various gcc warnings. This isn't critical since -Werror isn't used here but it helps ensure the test succeeds or fails for exactly the right reasons, and that reason is clear.

  • Prevent CONFIG_MMU from being redefined if it's already set
  • Prevent RCH_HAS_4LEVEL_HACK from being undefined if it's NOT already set
  • Silence uninit variable warnings by initializing pud, addr, gfp_mask before using them in an assignment. In the case of pud this was most easily done by simply changing it to a pud_t *

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants