mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dawson Engler <engler@csl.Stanford.EDU>
To: alan@lxorguk.ukuu.org.uk (Alan Cox)
Cc: nave@stanford.edu (Evan Parker),
	linux-kernel@vger.kernel.org, mc@CS.Stanford.EDU
Subject: Re: [CHECKER] repetitive/contradictory comparison bugs for 2.4.7
Date: Wed, 25 Jul 2001 18:13:34 -0700 (PDT)	[thread overview]
Message-ID: <200107260113.SAA11847@csl.Stanford.EDU> (raw)
In-Reply-To: <E15POo8-00020x-00@the-village.bc.nu> from "Alan Cox" at Jul 25, 2001 02:34:36 PM

bunch of quoting for context:

> > other 10 are questionable.  Those 10 are all simple variations on the
> > following code:
> > 
> > Start --->
> > 	if (!tmp_buf) {
> > 		page = get_free_page(GFP_KERNEL);
> > 
> > Error --->
> > 		if (tmp_buf)
> > 			free_page(page);
> > 		else
> > 			tmp_buf = (unsigned char *) page;
> > 	}
> 
> That one is not a bug. The serial drivers do this to handle a race. Really
> it should be
> 
> 		page = get_free_page(GFP_KERNEL)
> 
> 		rmb();
> 		if (tmp_buf)
> 			..
> 
> but this will go away as and when someone switches the tty layer to new 
> style locking. The precise code flow (under lock_kernel in both cases) is
> 
> 	
> 	if (!tmp_buf)
> 	{
> 		/* tmp_buf was 0
> 		page = get_free_page (...)
> 		[SLEEPS, TASK SWITCH]
> 

Does this mean that the 'cli' in the following code is redundant?

	/* 2.4.7/drivers/char/generic_serial.c:953:gs_init_port: */
        if (!tmp_buf) {
                page = get_free_page(GFP_KERNEL);

                cli (); /* Don't expect this to make a difference. */
                if (tmp_buf)
                        free_page(page);
                else
                        tmp_buf = (unsigned char *) page;

Dawson

  reply	other threads:[~2001-07-26  1:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-25  0:08 Evan Parker
2001-07-25  0:51 ` Neil Brown
2001-07-25  8:27 ` Russell King
2001-07-25 13:34 ` Alan Cox
2001-07-26  1:13   ` Dawson Engler [this message]
2001-07-26 19:54     ` Alex Bligh - linux-kernel
2001-07-26 20:15       ` Russell King
2001-07-26 22:07         ` Alan Cox
2001-07-26 22:06       ` Alan Cox
2001-07-26 22:24         ` Alex Bligh - linux-kernel

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=200107260113.SAA11847@csl.Stanford.EDU \
    --to=engler@csl.stanford.edu \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mc@CS.Stanford.EDU \
    --cc=nave@stanford.edu \
    /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

all inboxes | Powered by JetHome®