public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: "Penchala Narasimha Reddy Chilakala,
	TLS-Chennai" <narasimhareddyc@hcl.in>
Cc: James Bottomley <James.Bottomley@suse.de>,
	"'linux-scsi@vger.kernel.org'" <linux-scsi@vger.kernel.org>,
	ServeRAID Driver <ServeRAIDDriver@hcl.in>
Subject: Re: [PATCH ]  scsi-misc-2.6:  File System going into read-only mode
Date: Tue, 03 Nov 2009 20:02:49 +0100	[thread overview]
Message-ID: <4AF07E59.1070000@s5r6.in-berlin.de> (raw)
In-Reply-To: <4F2B1A2459C7AD4D96A23CE911C352CB1E914C8553@CHN-HCLT-EVS07.HCLT.CORP.HCL.IN>

Penchala Narasimha Reddy Chilakala, TLS-Chennai wrote:
> Hi Stefan,
> 
> Thanks a lot for your suggestion and feedback.
> 
> Aacraid driver has been using down_interruptible () and up () for
> quite some time. We will take your suggestion into consideration
> and keep in our mind. But it is quite difficult to implement your
> suggestion at this point of time as we need to modify the code in
> lot places and we need to test a lot.

dpcsup.c:	2x up(&fib->event_wait)
commsup.c:	allocation and initialization of the semaphore
		1x down_trylock(&fibptr->event_wait) +
		1x down_interruptible(&fibptr->event_wait) + up()
		1x up(&fib->event_wait)

So there are just two places which conditionally wait for completion (or
just one place but with a differentiation between sync and async mode),
and three places which signal "done".

You are right that this would be a non-trivial change and will require
respective testing.  However, (1.) only the place which waits for
completion is the non-trivial part (because it's currently coded in a
rather obfuscated way), (2.) I expect that the result would be cleaner
code which is (3.) more obvious to be correct and (4.) can also be
checked for correctness by the lockdep facility --- this is not possible
with legacy semaphores.

Anyway; it's up to those who use or maintain this driver.  I for one
converted another subsystem away from two or three different misused
semaphores to more appropriate APIs and it wasn't too hard; but I can't
do this for aacraid since I don't have hardware to test.

(In my rather irrelevant opinion, whatever you decide for now, just do
_not_ do this here:

>>> we can replace the above code with either
>>>
>>>             } else if (down_interruptible (&fibptr->event_wait));
>>>
>>>                         Or
>>>
>>>             } else {
>>>                  if (down_interruptible (&fibptr->event_wait))
>>>                         ;
>>>             }

because it can really hurt in the long run if sensible warnings are hidden.)
-- 
Stefan Richter
-=====-==--= =-== ---==
http://arcgraph.de/sr/

  reply	other threads:[~2009-11-03 19:03 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02  7:35 [PATCH ] scsi-misc-2.6: File System going into read-only mode Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-02 16:30 ` Stefan Richter
2009-11-03  9:54   ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-03 19:02     ` Stefan Richter [this message]
2009-11-04  7:00       ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-04  9:18       ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-04 14:48         ` Stefan Richter
2009-11-02 17:45 ` James Bottomley
2009-11-03  9:38   ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-03 15:08     ` James Bottomley
2009-11-04  7:07       ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-04 15:42         ` James Bottomley
  -- strict thread matches above, loose matches on Subject: below --
2009-12-24  6:29 Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-12-21 13:09 Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-12-18 12:25 Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-11-05 13:27 Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-11 19:26 ` James Bottomley
2009-11-12  8:28   ` Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-11-13 20:55     ` James Bottomley
2009-11-16  3:25       ` Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-11-16 15:51         ` James Bottomley
2009-11-17  5:22           ` Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-11-17  5:27           ` Penchala Narasimha Reddy Chilakala, ERS-HCLTech
2009-10-09  9:23 Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-10-22  1:09 ` James Bottomley
2009-10-23 13:10   ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-09-29  8:47 Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-09-29 14:19 ` James Bottomley
2009-09-30 11:09   ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-09-30 11:33     ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-10-07  6:02       ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-02 17:46 ` James Bottomley
2009-11-03 10:17   ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-03 14:40     ` James Bottomley
2009-11-04  1:23       ` Stefan Richter
2009-11-04  1:33         ` Stefan Richter
2009-11-04  1:40           ` Stefan Richter
2009-11-04  6:44         ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-04  7:21       ` Penchala Narasimha Reddy Chilakala, TLS-Chennai
2009-11-04 15:30         ` James Bottomley

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=4AF07E59.1070000@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=James.Bottomley@suse.de \
    --cc=ServeRAIDDriver@hcl.in \
    --cc=linux-scsi@vger.kernel.org \
    --cc=narasimhareddyc@hcl.in \
    /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