All of lore.kernel.org
 help / color / mirror / Atom feed
* kernfs: can read/write method grow buffer size?
@ 2019-03-29  3:09 Marek Behun
  2019-03-29  6:22 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 10+ messages in thread
From: Marek Behun @ 2019-03-29  3:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Tejun Heo
  Cc: linux-kernel, Pavel Machek, Jacek Anaszewski

Hello Tejun and Greg,

kernfs_fop_open/read/write allocates a buffer for the ->read, ->write,
or ->seq_read methods. This buffer is either preallocated or allocated
on the spot, with minimum size being PAGE_SIZE, if ->atomic_write_len
is not given.

There is a question/problem currently in the led-trigger API, that the
PAGE_SIZE buffer can in some specific scenarios be too short.
(The trigger file on read returns space separated list of all supported
triggers, and the currently chosen one is marked specially. The cpu
activity trigger lists "cpu%i" for all CPU cores, which actually broke
on some machines with very large number of CPUs. Granted, this could
have been solved another way (and maybe will be), but we are now
discussing API for HW LED triggers, which can raise the problem anyway,
if a specific LED controller supports too many HW LED triggers.)

Is it allowed to grow this buffer if needed, either via krealloc or by
creating a special function in kernfs API which does this so that
led-trigger could use it?

Or is this completely forbidden?

Thank you.

Marek

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-03-29 10:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-29  3:09 kernfs: can read/write method grow buffer size? Marek Behun
2019-03-29  6:22 ` Greg Kroah-Hartman
2019-03-29  6:51   ` Marek Behun
2019-03-29  6:58     ` Greg Kroah-Hartman
2019-03-29  8:34   ` Pavel Machek
2019-03-29  8:48     ` Marek Behun
2019-03-29 10:24       ` Greg Kroah-Hartman
2019-03-29 10:26         ` Greg Kroah-Hartman
2019-03-29 10:38           ` Pavel Machek
2019-03-29 10:32         ` Pavel Machek

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.