Message-ID: <37F0EB85.16EB59E4@netapp.com>
From: Randy Thelen <rthelen@netapp.com>
Organization: Network Appliance Inc.
X-Mailer: Mozilla 4.04 [en] (X11; U; Linux 2.0.0 i686)
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Re: On tty_inhibited
References: <37E7CE9D.F74021E9@unex.es>
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
Lines: 41
Date: Tue, 28 Sep 1999 09:23:33 -0700
NNTP-Posting-Host: 10.100.4.73
X-Complaints-To: kls@netapp.com
X-Trace: chrome.eng.netapp.com 938535692 10.100.4.73 (Tue, 28 Sep 1999 09:21:32 PDT)
NNTP-Posting-Date: Tue, 28 Sep 1999 09:21:32 PDT
Path: news.adfa.oz.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!ozemail.com.au!nsw.nntp.telstra.net!intgwpad.nntp.telstra.net!newspump.monmouth.com!newspeer.monmouth.com!hermes.visi.com!news-out.visi.com!cam-news-hub1.bbnplanet.com!sanjose-news-feed1.bbnplanet.com!news.gtei.net!chrome.eng.netapp.com!not-for-mail

Juan Carlos Daz Martn wrote:
> 
> I'm worried about the cons_write function. Look at the last line of the
> code:
> 
> ----------------------------------------------------------------------------------------------
> 
> 15251   do {
> 15252         if (count > sizeof(buf)) count = sizeof(buf);
> 15253         user_phys = proc_vir2phys(proc_addr(tp->tty_outproc),
>                                         tp->tty_out_vir);
> 15254         phys_copy(user_phys, vir2phys(buf), (phys_bytes) count);
....
> 15278   } while ((count = tp->tty_outleft) != 0 && !tp->tty_inhibited);
> ----------------------------------------------------------------------------------------------
> 
> My question is:
> Can these loops be interrupted in such a way that tty_inhibited gets
> true in the middle???
> 
> My opinion is NO. So, wouldn't be better the last line as simply:
> 
> 15278   } while ((count = tp->tty_outleft) != 0 );
> 
> Where am I wrong???

I'd be concerned about phys_copy() and proc_vir2phys().  Both should not
block in the general case.  But, suppose the target block in either
proc_vir2phys() or phys_copy() had been backed to a disk: then that
block would have to get loaded back into RAM.   That's a blocking call. 
However, that won't happen here.  But, it looks like the code is
sensitive to that possibility.

Those are the only direct function calls I can see.  Drop the '&&
!inhibited' thing, if you think it will speed things up significantly. 
:-)

-- Randy

ps: You're mail opens with an expression of your concern.  What are you
concerned about?
