lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 21 Sep 2008 20:37:57 +0200
From:	Krzysztof Helt <krzysztof.h1@...zta.fm>
To:	Marcin Slusarz <marcin.slusarz@...il.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	linux-fbdev-devel@...ts.sourceforge.net,
	Antonino Daplas <adaplas@...il.com>
Subject: Re: [Linux-fbdev-devel] [PATCH 1/2] vgacon: optimize scrolling

On Sun, 21 Sep 2008 18:00:08 +0200
Marcin Slusarz <marcin.slusarz@...il.com> wrote:

> Join multiple scr_memcpyw into 1-3 calls (usually 2).
> (benchmarked average speedup: 1%)
> 

The scr_memcpyw is an inline function so there is no real call here.

However, have you tested the patch with scroll range > 2 *  vgacon_scrollback_size?

It seems that your patch only handles scrolling if it is not bigger than 2 * vgacon_scrollback_size.

Regards,
Krzysztof

> Signed-off-by: Marcin Slusarz <marcin.slusarz@...il.com>
> Cc: Antonino Daplas <adaplas@...il.com>
> Cc: linux-fbdev-devel@...ts.sourceforge.net
> ---
>  drivers/video/console/vgacon.c |   28 ++++++++++++++++------------
>  1 files changed, 16 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
> index bd1f57b..de4f66c 100644
> --- a/drivers/video/console/vgacon.c
> +++ b/drivers/video/console/vgacon.c
> @@ -292,23 +292,27 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines)
>  	d = (void *) c->vc_origin;
>  	s = (void *) c->vc_screenbuf;
>  
> -	while (count--) {
> -		scr_memcpyw(d, vgacon_scrollback + soff, c->vc_size_row);
> -		d += c->vc_size_row;
> -		soff += c->vc_size_row;
> -
> -		if (soff >= vgacon_scrollback_size)
> -			soff = 0;
> +	if (count) {
> +		int copysize;
> +		count *= c->vc_size_row;
> +		/* how much memory to end of buffer left? */
> +		copysize = min(count, vgacon_scrollback_size - soff);
> +		scr_memcpyw(d, vgacon_scrollback + soff, copysize);
> +		d += copysize;
> +		count -= copysize;
> +		
> +		if (count) {
> +			copysize = min(count, vgacon_scrollback_size);
> +			scr_memcpyw(d, vgacon_scrollback, copysize);
> +			d += copysize;
> +		}
>  	}
>  
>  	if (diff == c->vc_rows) {
>  		vgacon_cursor(c, CM_MOVE);
>  	} else {
> -		while (diff--) {
> -			scr_memcpyw(d, s, c->vc_size_row);
> -			d += c->vc_size_row;
> -			s += c->vc_size_row;
> -		}
> +		if (diff)
> +			scr_memcpyw(d, s, diff * c->vc_size_row);
>  	}
>  
>  	return 1;
> -- 
> 1.5.6.4
> 
> 
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Linux-fbdev-devel mailing list
> Linux-fbdev-devel@...ts.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-fbdev-devel
> 

----------------------------------------------------------------------
Kredyt Hipoteczny w Banku Millennium - zdobywca Zlotego Lauru Klienta!
Sprawdz >> http://link.interia.pl/f1f15

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ