All of lore.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 219226] New: Invalid BPF_MAP_TYPE_PERCPU_ARRAY value size limits
Date: Tue, 03 Sep 2024 15:37:35 +0000	[thread overview]
Message-ID: <bug-219226-11311@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=219226

            Bug ID: 219226
           Summary: Invalid BPF_MAP_TYPE_PERCPU_ARRAY value size limits
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: man-pages
          Assignee: documentation_man-pages@kernel-bugs.osdl.org
          Reporter: kernel@dimka.rocks
        Regression: No

Not a man page but I'm not sure where else to submit, it's part of the docs.

In Documentation/bpf/map_array.rst in the end of the first paragraph

> The value stored can be of any size, however, all array elements are aligned
> to 8 bytes.

should be changed to:

> The value stored can be of any size for BPF_MAP_TYPE_ARRAY and not more than
> PCPU_MIN_UNIT_SIZE (currently 32 kB) for BPF_MAP_TYPE_PERCPU_ARRAY. All array
> elements are aligned to 8 bytes.



The limitation is in linux/mm/percpu.c

        if (unlikely(!size || size > PCPU_MIN_UNIT_SIZE || align > PAGE_SIZE ||
                     !is_power_of_2(align))) {
                WARN(do_warn, "illegal size (%zu) or align (%zu) for percpu
allocation\n",
                     size, align);
                return NULL;
        }


PCPU_MIN_UNIT_SIZE defined in include/linux/percpu.h as "PFN_ALIGN(32 << 10)"

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

                 reply	other threads:[~2024-09-03 15:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-219226-11311@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.