Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Bruce Evans
On Tue, 4 Nov 2014, Brooks Davis wrote: On Tue, Nov 04, 2014 at 06:41:44AM +0100, Mateusz Guzik wrote: re-sent with trimmed cc On Mon, Nov 03, 2014 at 07:35:56PM +, Poul-Henning Kamp wrote: In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: This optimization

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Brooks Davis
On Tue, Nov 04, 2014 at 06:41:44AM +0100, Mateusz Guzik wrote: > re-sent with trimmed cc > > On Mon, Nov 03, 2014 at 07:35:56PM +, Poul-Henning Kamp wrote: > > > > In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: > > > > >This optimization is probably minor, but

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Alfred Perlstein
> On Nov 4, 2014, at 6:22 AM, Alfred Perlstein wrote: > > > >>> On Nov 4, 2014, at 1:25 AM, Konstantin Belousov wrote: >>> >>> On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: >>> Isn't there a problem where the stack can be swapped out? >>> >>> I seem to recall a problem

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Alfred Perlstein
> On Nov 4, 2014, at 1:25 AM, Konstantin Belousov wrote: > >> On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: >> Isn't there a problem where the stack can be swapped out? >> >> I seem to recall a problem where a swapped out process was causing >> problems due to a buffer pas

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Poul-Henning Kamp
In message <20141104053520.ga4...@dft-labs.eu>, Mateusz Guzik writes: >On Mon, Nov 03, 2014 at 07:35:56PM +, Poul-Henning Kamp wrote: >> >> In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: >> >> >This optimization is probably minor, but reminds me of oth

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Mateusz Guzik
On Mon, Nov 03, 2014 at 07:35:56PM +, Poul-Henning Kamp wrote: > > In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: > > >This optimization is probably minor, but reminds me of other syscalls > >that would benefit using a single largish allocation up front: > >- a

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Konstantin Belousov
On Tue, Nov 04, 2014 at 06:03:29AM +1100, Bruce Evans wrote: > Why not just use a C99 VLA? It doesn't require any compiler magic except > being a C99 compiler (I haven't seen any of those yet, but some approximate > C99 for VLAs). I use this in delayed signal delivery code in libthr. > > You (ki

Re: svn commit: r274017 - head/sys/kern

2014-11-04 Thread Konstantin Belousov
On Mon, Nov 03, 2014 at 01:45:21PM -0800, Alfred Perlstein wrote: > Isn't there a problem where the stack can be swapped out? > > I seem to recall a problem where a swapped out process was causing > problems due to a buffer passed being stack allocated and that process > being swapped out... >

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Mateusz Guzik
re-sent with trimmed cc On Mon, Nov 03, 2014 at 07:35:56PM +, Poul-Henning Kamp wrote: > > In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: > > >This optimization is probably minor, but reminds me of other syscalls > >that would benefit using a single largish al

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Hans Petter Selasky
On 11/03/14 22:45, Alfred Perlstein wrote: +u_char smalldata[128]; You should make sure the smalldata is properly aligned, hence on ARM it might cause aligment faults, if fields inside the IOCTL are not accessed with proper alignment. --HPS __

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Alfred Perlstein
Isn't there a problem where the stack can be swapped out? I seem to recall a problem where a swapped out process was causing problems due to a buffer passed being stack allocated and that process being swapped out... If this is not the case then please disregard. -Alfred On 11/2/14, 11:46 P

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Poul-Henning Kamp
In message <20141104045159.e1...@besplex.bde.org>, Bruce Evans writes: >This optimization is probably minor, but reminds me of other syscalls >that would benefit using a single largish allocation up front: >- all vfs calls that start with namei(). They allocate PATH_MAX (1K) > bytes an

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Bruce Evans
On Mon, 3 Nov 2014, Konstantin Belousov wrote: On Mon, Nov 03, 2014 at 10:21:32AM +0100, Mateusz Guzik wrote: On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: On 11/03/14 09:23, Julian Elischer wrote: On 11/3/14, 4:21 PM, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateus

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Bruce Evans
On Mon, 3 Nov 2014, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for small ioctl requests. I'm not sure I like

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Konstantin Belousov
On Mon, Nov 03, 2014 at 10:21:32AM +0100, Mateusz Guzik wrote: > On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: > > On 11/03/14 09:23, Julian Elischer wrote: > > >On 11/3/14, 4:21 PM, Julian Elischer wrote: > > >>On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > > >>>Author: mjg > >

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Hans Petter Selasky
On 11/03/14 10:21, Mateusz Guzik wrote: On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: On 11/03/14 09:23, Julian Elischer wrote: On 11/3/14, 4:21 PM, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision:

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Mateusz Guzik
On Mon, Nov 03, 2014 at 09:29:06AM +0100, Hans Petter Selasky wrote: > On 11/03/14 09:23, Julian Elischer wrote: > >On 11/3/14, 4:21 PM, Julian Elischer wrote: > >>On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > >>>Author: mjg > >>>Date: Mon Nov 3 07:46:51 2014 > >>>New Revision: 274017 > >>>URL: http

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Hans Petter Selasky
On 11/03/14 10:08, Mateusz Guzik wrote: On Mon, Nov 03, 2014 at 04:21:02PM +0800, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack t

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Mateusz Guzik
On Mon, Nov 03, 2014 at 04:21:02PM +0800, Julian Elischer wrote: > On 11/3/14, 3:46 PM, Mateusz Guzik wrote: > >Author: mjg > >Date: Mon Nov 3 07:46:51 2014 > >New Revision: 274017 > >URL: https://svnweb.freebsd.org/changeset/base/274017 > > > >Log: > > Provide an on-stack temporary buffer for s

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Bruce Simpson
On Mon, 3 Nov 2014, at 08:21, Julian Elischer wrote: > I'm open to being persuaded but I think we need to have a discussion > about stack usage. We used to say that anything greater that, say > 64 bytes should probably be allocated. I have to admit the level of stack usage in my current $DAYJOB pr

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Hans Petter Selasky
On 11/03/14 09:23, Julian Elischer wrote: On 11/3/14, 4:21 PM, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Julian Elischer
On 11/3/14, 4:21 PM, Julian Elischer wrote: On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for small ioctl requests. I'm not sure I like

Re: svn commit: r274017 - head/sys/kern

2014-11-03 Thread Julian Elischer
On 11/3/14, 3:46 PM, Mateusz Guzik wrote: Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for small ioctl requests. I'm not sure I like this. We don't know how many more levels of

svn commit: r274017 - head/sys/kern

2014-11-02 Thread Mateusz Guzik
Author: mjg Date: Mon Nov 3 07:46:51 2014 New Revision: 274017 URL: https://svnweb.freebsd.org/changeset/base/274017 Log: Provide an on-stack temporary buffer for small ioctl requests. Modified: head/sys/kern/sys_generic.c Modified: head/sys/kern/sys_generic.c ==