lkml.org 
[lkml]   [1998]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: 2.1.118 Tons of oopes


On Tue, 1 Sep 1998, Richard Gooch wrote:
> >
> > As such, NULL pointers can often be the _default_ rather than being a
> > sign of error cases. And the NULL case may be the fast and
> > timing-sensitive one. This is true of the dcache hashing stuff, for
> > example, where there are special (and slow) routines for certain
> > filesystems that want to do stupid name mangling.
>
> OK, so requiring stubs for the dcache operations doesn't make
> sense. That still leaves the file and inode operations (which also see
> more frequent extensions being made). Would it make sense (shave a few
> cycles and remove the ugly tests) for the file and inode ops?

Potentially. I've thought about it on and off, but it's painful to add the
entries to every single driver, and the win has never been very big.

Also note that many of the current NULL checks (not the ones for the fops
thing, but for other things) are superfluous: we check for NULL not
because we need to, but often because it's just an almost automatic thing
for me.

For example, there is sometimes code essentially like this (see
sys_lseek(), for example)

struct dentry * dentry;
struct inode * inode;
struct file * filp = fget(fd);

if (!filp)
return -EBADF;

dentry = filp->f_dentry;
if (!dentry)
return -EBADF;

inode = dentry->d_inode;
if (!inode)
return -BADF;

and the only check that needs to be done is really the filp one: if you
get a filp that is active, then the dentry and inode had better be there,
because it would be a major error (worthy of a kernel oops) if they
weren't, so checking for dentry/inode being non-NULL is unnecessary, but
often done simply because I and others have been anal about it.

Personally, I would suggest against changing all the file and inode
operations unless somebody can show cases where it makes a real-world
difference in performance..

Linus


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

\
 
 \ /
  Last update: 2005-03-22 13:44    [W:0.055 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site