Re: [PATCH RFC 4/4] mm/page_alloc_test: Add smoke-test for page allocation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 Feb 2025 at 15:47, Brendan Jackman <jackmanb@xxxxxxxxxx> wrote:
> +static inline struct page *alloc_pages_force_nid(struct kunit *test,
> +                                                gfp_t gfp, int order, int nid)
> +{
> +       NODEMASK_ALLOC(nodemask_t, nodemask, GFP_KERNEL);
> +       struct page *page;
> +
> +       KUNIT_ASSERT_NOT_NULL(test, nodemask);
> +       kunit_add_action(test, action_nodemask_free, &nodemask);
> +       nodes_clear(*nodemask);
> +       node_set(nid, *nodemask);
> +
> +       page = __alloc_pages_noprof(GFP_KERNEL, 0, nid, nodemask);

Oops, it's ignoring the gfp argument here.

> +       { .gfp_flags = GFP_DMA32,       .want_zone = ZONE_NORMAL },

And with that fixed, it becomes clear DMA32 allocations can't be
expected to succeed in this zone setup.

(Anyway, it's a bit of a silly test regardless, just something to
illustrate the KUnit idea).




[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux