From: Richard Cochran <richardcochran@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: yuanhan.liu@linux.intel.com, changlongx.xie@intel.com,
fengguang.wu@intel.com, netdev@vger.kernel.org
Subject: Re: [net-next:master 122/152] drivers/ptp/ptp_chardev.c:36 ptp_ioctl() warn: 'sysoff' puts 832 bytes on stack
Date: Sat, 3 Nov 2012 05:53:39 +0100 [thread overview]
Message-ID: <20121103045339.GA2277@netboy.at.omicron.at> (raw)
In-Reply-To: <20121102.213928.934210347094361569.davem@davemloft.net>
On Fri, Nov 02, 2012 at 09:39:28PM -0400, David Miller wrote:
> > I am aware that these methods use large stack buffers, but I thought
> > it was okay seeing as they are both under the 1k limit.
>
> I think you should avoid such a local stack variable here.
>
> It's not that big of a deal to use kmalloc or whatever so just
> do that and add the necessary kfree cleanups et al.
The usage pattern will be that the user calls these again and
again. For the sysoff it will be at least once every second, and for
the events it could be ASAP in a tight loop.
Isn't it being nicer to the memory allocation code not to repeatedly
request small chunks?
Thanks,
Richard
next prev parent reply other threads:[~2012-11-03 4:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <509326ff.Rs30l/1GTlOl9dW+%yuanhan.liu@linux.intel.com>
2012-11-02 2:06 ` [net-next:master 122/152] drivers/ptp/ptp_chardev.c:36 ptp_ioctl() warn: 'sysoff' puts 832 bytes on stack Yuanhan Liu
2012-11-02 8:59 ` Richard Cochran
2012-11-03 1:39 ` David Miller
2012-11-03 4:53 ` Richard Cochran [this message]
2012-11-03 5:39 ` David Miller
2012-11-26 11:44 ` [PATCH net-next 1/2] ptp: reduce stack usage when reading external time stamps Richard Cochran
2012-11-26 11:44 ` [PATCH net-next 2/2] ptp: reduce stack usage when measuring the system time offset Richard Cochran
2012-11-26 22:23 ` David Miller
2012-11-26 22:23 ` [PATCH net-next 1/2] ptp: reduce stack usage when reading external time stamps David Miller
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=20121103045339.GA2277@netboy.at.omicron.at \
--to=richardcochran@gmail.com \
--cc=changlongx.xie@intel.com \
--cc=davem@davemloft.net \
--cc=fengguang.wu@intel.com \
--cc=netdev@vger.kernel.org \
--cc=yuanhan.liu@linux.intel.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;
as well as URLs for NNTP newsgroup(s).