From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Tian Tao <tiantao6@hisilicon.com>
Cc: gregkh@linuxfoundation.org, rafael@kernel.org,
akpm@linux-foundation.org, jonathan.cameron@huawei.com,
song.bao.hua@hisilicon.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/3] topology: use bin_attribute to avoid buff overflow
Date: Wed, 2 Jun 2021 18:48:37 +0300 [thread overview]
Message-ID: <YLeoVVF8z4ikaRnp@smile.fi.intel.com> (raw)
In-Reply-To: <1622641734-22538-3-git-send-email-tiantao6@hisilicon.com>
On Wed, Jun 02, 2021 at 09:48:53PM +0800, Tian Tao wrote:
> Reading sys/devices/system/cpu/cpuX/topology/ returns cpu topology.
> However, the size of this file is limited to PAGE_SIZE because of the
> limitation for sysfs attribute. so we use bin_attribute instead of
> attribute to avoid NR_CPUS too big to cause buff overflow.
> This patch is based on the following discussion.
> https://lore.kernel.org/lkml/20210319041618.14316-2-song.bao.hua@hisilicon.com/
Link: tag?
...
> +static struct bin_attribute *bin_attrs[] = {
> + &bin_attr_core_cpus,
> + &bin_attr_core_cpus_list,
> + &bin_attr_thread_siblings,
> + &bin_attr_thread_siblings_list,
> + &bin_attr_core_siblings,
> + &bin_attr_core_siblings_list,
> + &bin_attr_die_cpus,
> + &bin_attr_die_cpus_list,
> + &bin_attr_package_cpus,
> + &bin_attr_package_cpus_list,
> +#ifdef CONFIG_SCHED_BOOK
> + &bin_attr_book_siblings,
> + &bin_attr_book_siblings_list,
> +#endif
> +#ifdef CONFIG_SCHED_DRAWER
> + &bin_attr_drawer_siblings,
> + &bin_attr_drawer_siblings_list,
> +#endif
> + NULL,
No comma for terminator line.
> +};
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-06-02 15:49 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-02 13:48 [PATCH v2 0/3] use bin_attribute to avoid buff overflow Tian Tao
2021-06-02 13:48 ` [PATCH v2 1/3] lib: bitmap: introduce bitmap_print_to_buf Tian Tao
2021-06-02 14:22 ` Jonathan Cameron
2021-06-02 15:47 ` Andy Shevchenko
2021-06-02 13:48 ` [PATCH v2 2/3] topology: use bin_attribute to avoid buff overflow Tian Tao
2021-06-02 15:48 ` Andy Shevchenko [this message]
2021-06-02 13:48 ` [PATCH v2 3/3] drivers/base/node.c: " Tian Tao
2021-06-02 15:50 ` Andy Shevchenko
2021-06-02 15:42 ` [PATCH v2 0/3] " Andy Shevchenko
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=YLeoVVF8z4ikaRnp@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=jonathan.cameron@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=rafael@kernel.org \
--cc=song.bao.hua@hisilicon.com \
--cc=tiantao6@hisilicon.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox