NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/60180: radeon* is problematically slow



The following reply was made to PR kern/60180; it has been noted by GNATS.

From: mlelstv%serpens.de@localhost (Michael van Elst)
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: kern/60180: radeon* is problematically slow
Date: Fri, 10 Apr 2026 07:13:48 -0000 (UTC)

 gnats-admin%NetBSD.org@localhost ("john%klos.com@localhost via gnats") writes:
 
 >While the cat is running on the Radeon console, the whole system becomes significantly
 >slower:
 
 
 That's not related to Radeon. Any kind of output to a framebuffer
 console is slow, in particular when there is no hardware support
 for scrolling.
 
 The whole system slows down because console output is done under
 KERNEL_LOCK.
 
 I use a patched wscons that avoids this. It probably leaves a
 small chance for a race that can disrupt the display. I sometimes
 see it for e.g. panic messages.
 
 Index: wsdisplay_vcons.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/wscons/wsdisplay_vcons.c,v
 retrieving revision 1.70
 diff -p -u -r1.70 wsdisplay_vcons.c
 --- wsdisplay_vcons.c	28 Apr 2025 07:43:41 -0000	1.70
 +++ wsdisplay_vcons.c	10 Apr 2026 07:05:30 -0000
 @@ -215,7 +215,7 @@ vcons_init_common(struct vcons_data *vd,
  	vdp->wanted = NULL;
  	vdp->currenttype = def;
  	vdp->defaulttype = def;
 -	callout_init(&vdp->switch_callout, 0);
 +	callout_init(&vdp->switch_callout, CALLOUT_MPSAFE);
  	callout_setfunc(&vdp->switch_callout, vcons_do_switch, vd);
  #ifdef VCONS_DRAW_INTR
  	vdp->cells = 0;
 @@ -234,7 +234,8 @@ vcons_init_common(struct vcons_data *vd,
  #endif
  #ifdef VCONS_DRAW_INTR
  	if (enable_intr) {
 -		vdp->intr_softint = softint_establish(SOFTINT_SERIAL,
 +		vdp->intr_softint = softint_establish(
 +		    SOFTINT_SERIAL | SOFTINT_MPSAFE,
  		    vcons_softintr, vd);
  		callout_init(&vdp->intr, CALLOUT_MPSAFE);
  		callout_setfunc(&vdp->intr, vcons_intr, vd);
 @@ -766,8 +767,8 @@ void
  vcons_update_screen(struct vcons_screen *scr)
  {
  #ifdef VCONS_DRAW_INTR
 -	uint32_t *charptr = scr->scr_chars;
 -	long *attrptr = scr->scr_attrs;
 +	uint32_t *charptr = scr->scr_chars, c;
 +	long *attrptr = scr->scr_attrs, a;
  	struct rasops_info *ri = &scr->scr_ri;
  	struct vcons_data *vd = scr->scr_vd;
  	struct vcons_data_private *vdp = vd->private;
 @@ -799,12 +800,14 @@ vcons_update_screen(struct vcons_screen 
  				 * and we already made sure the screen we're
  				 * working on is visible
  				 */
 -				if ((vdp->chars[boffset] != charptr[offset]) ||
 -				    (vdp->attrs[boffset] != attrptr[offset])) {
 -					scr->putchar(ri, i, j,
 -				 	   charptr[offset], attrptr[offset]);
 -					vdp->chars[boffset] = charptr[offset];
 -					vdp->attrs[boffset] = attrptr[offset];
 +				c = charptr[offset];
 +				a = attrptr[offset];
 +
 +				if ((vdp->chars[boffset] != c) ||
 +				    (vdp->attrs[boffset] != a)) {
 +					scr->putchar(ri, i, j, c, a);
 +					vdp->chars[boffset] = c;
 +					vdp->attrs[boffset] = a;
  				}
  				offset++;
  				boffset++;
 @@ -1379,20 +1382,26 @@ vcons_cursor_noread(void *cookie, int on
  	struct rasops_info *ri = cookie;
  	struct vcons_screen *scr = ri->ri_hw;
  	int offset = 0, ofs;
 +	int orow, ocol;
  
  #ifdef WSDISPLAY_SCROLLSUPPORT
  	offset = scr->scr_current_offset;
  #endif
 -	ofs = offset + ri->ri_crow * ri->ri_cols + ri->ri_ccol;
 +
 +	orow = ri->ri_crow;
 +	ocol = ri->ri_ccol;
 +	ri->ri_crow = row;
 +	ri->ri_ccol = col;
 +
 +	ofs = offset + orow * ri->ri_cols + ocol;
  	if ((ri->ri_flg & RI_CURSOR) &&
  	   (((scr->scr_flags & VCONS_DONT_READ) != VCONS_DONT_READ) || on)) {
 -		scr->putchar(cookie, ri->ri_crow, ri->ri_ccol,
 +		scr->putchar(cookie, orow, ocol,
  		    scr->scr_chars[ofs], scr->scr_attrs[ofs]);
  		ri->ri_flg &= ~RI_CURSOR;
  	}
 -	ri->ri_crow = row;
 -	ri->ri_ccol = col;
 -	ofs = offset + ri->ri_crow * ri->ri_cols + ri->ri_ccol;
 +
 +	ofs = offset + row * ri->ri_cols + col;
  	if (on) {
  		scr->putchar(cookie, row, col, scr->scr_chars[ofs],
  #ifdef VCONS_DEBUG_CURSOR_NOREAD
 



Home | Main Index | Thread Index | Old Index