platform/kernel/linux-starfive.git
17 years ago[PATCH] knfsd: close a race-opportunity in d_splice_alias
NeilBrown [Wed, 4 Oct 2006 09:16:16 +0000 (02:16 -0700)]
[PATCH] knfsd: close a race-opportunity in d_splice_alias

There is a possible race in d_splice_alias.  Though __d_find_alias(inode, 1)
will only return a dentry with DCACHE_DISCONNECTED set, it is possible for it
to get cleared before the BUG_ON, and it is is not possible to lock against
that.

There are a couple of problems here.  Firstly, the code doesn't match the
comment.  The comment describes a 'disconnected' dentry as being IS_ROOT as
well as DCACHE_DISCONNECTED, however there is not testing of IS_ROOT anythere.

A dentry is marked DCACHE_DISCONNECTED when allocated with d_alloc_anon, and
remains DCACHE_DISCONNECTED while a path is built up towards the root.  So a
dentry can have a valid name and a valid parent and even grandparent, but will
still be DCACHE_DISCONNECTED until a path to the root is created.  Once the
path to the root is complete, everything in the path gets DCACHE_DISCONNECTED
cleared.  So the fact that DCACHE_DISCONNECTED isn't enough to say that a
dentry is free to be spliced in with a given name.  This can only be allowed
if the dentry does not yet have a name, so the IS_ROOT test is needed too.

However even adding that test to __d_find_alias isn't enough.  As
d_splice_alias drops dcache_lock before calling d_move to perform the splice,
it could race with another thread calling d_splice_alias to splice the inode
in with a different name in a different part of the tree (in the case where a
file has hard links).  So that splicing code is only really safe for
directories (as we know that directories only have one link).  For
directories, the caller of d_splice_alias will be holding i_mutex on the
(unique) parent so there is no room for a race.

A consequence of this is that a non-directory will never benefit from being
spliced into a pre-exisiting dentry, but that isn't a problem.  It is
perfectly OK for a non-directory to have multiple dentries, some anonymous,
some not.  And the comment for d_splice_alias says that it only happens for
directories anyway.

Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Dipankar Sarma <dipankar@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: fix auto-sizing of nfsd request/reply buffers
NeilBrown [Wed, 4 Oct 2006 09:16:15 +0000 (02:16 -0700)]
[PATCH] knfsd: fix auto-sizing of nfsd request/reply buffers

totalram is measured in pages, not bytes, so PAGE_SHIFT must be used when
trying to find 1/4096 of RAM.

Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: fix refount on nsm
NeilBrown [Wed, 4 Oct 2006 09:16:15 +0000 (02:16 -0700)]
[PATCH] knfsd: lockd: fix refount on nsm

If nlm_lookup_host finds what it is looking for it exits with an extra
reference on the matching 'nsm' structure.

So don't actually count the reference until we are (fairly) sure it is going
to be used.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: acls: fix handling of zero-length acls
J.Bruce Fields [Wed, 4 Oct 2006 09:16:14 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: acls: fix handling of zero-length acls

It is legal to have zero-length NFSv4 acls; they just deny everything.

Also, nfs4_acl_nfsv4_to_posix will always return with pacl and dpacl set on
success, so the caller doesn't need to check this.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: acls: simplify nfs4_acl_nfsv4_to_posix interface
J.Bruce Fields [Wed, 4 Oct 2006 09:16:13 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: acls: simplify nfs4_acl_nfsv4_to_posix interface

There's no need to handle the case where the caller passes in null for pacl or
dpacl; no caller does that, because it would be a dumb thing to do.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: acls: fix inheritance
J.Bruce Fields [Wed, 4 Oct 2006 09:16:12 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: acls: fix inheritance

We can be a little more flexible about the flags allowed for inheritance (in
particular, we can deal with either the presence or the absence of
INHERIT_ONLY), but we should probably reject other combinations that we don't
understand.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: acls: relax the nfsv4->posix mapping
J.Bruce Fields [Wed, 4 Oct 2006 09:16:11 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: acls: relax the nfsv4->posix mapping

Use a different nfsv4->(draft posix) acl mapping which is
1. completely backwards compatible,
2. accepts any nfsv4 acl, and
3. errs on the side of restricting permissions.

In detail:

1. completely backwards compatible: The new mapping produces the
same result on any acl produced by the existing (draft
posix)->nfsv4 mapping; the one exception is that we no longer
attempt to guess the value of the mask by assuming certain denies
represent the mask.  Since the server still keeps track of the mask
locally, sequences of chmod's will still be handled fine; the only
thing this will change is sequences of chmod's with intervening
read-modify-writes of the acl.  That last case just isn't worth the
trouble and the possible misrepresentations of the user's intent
(if we guess that a certain deny indicates masking is in effect
when it really isn't).

2. accepts any nfsv4 acl: That's not quite true: we still reject
acls that use combinations of inheritance flags that we don't
support.  We also reject acls that attempt to explicitly deny
read_acl or read_attributes permissions, or that attempt to deny
write_acl or write_attributes permissions to the owner of the file.

3.  errs on the side of restricting permissions: one exception to
this last rule: we totally ignore some bits (write_owner,
synchronize, read_named_attributes, etc.) that are completely alien
to our filesystem semantics, in some cases even if that would mean
ignoring an explicit deny that we have no intention of enforcing.
Excepting that, the posix acl produced should be the most
permissive acl that is not more permissive than the given nfsv4
acl.

And the new code's shorter, too.  Neato.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: clean up exp_pseudoroot
J.Bruce Fields [Wed, 4 Oct 2006 09:16:10 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: clean up exp_pseudoroot

The previous patch enables some minor simplification here.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd4: refactor exp_pseudoroot
J.Bruce Fields [Wed, 4 Oct 2006 09:16:09 +0000 (02:16 -0700)]
[PATCH] knfsd: nfsd4: refactor exp_pseudoroot

We could be using more common code in exp_pseudoroot().  This will also
simplify some changes we need to make later.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: svcrpc: use consistent variable name for the reply state
J.Bruce Fields [Wed, 4 Oct 2006 09:16:08 +0000 (02:16 -0700)]
[PATCH] knfsd: svcrpc: use consistent variable name for the reply state

The rpc reply has multiple levels of error returns.  The code here contributes
to the confusion by using "accept_statp" for a pointer to what the rfc (and
wireshark, etc.) refer to as the "reply_stat".  (The confusion is compounded
by the fact that the rfc also has an "accept_stat" which follows the
reply_stat in the succesful case.)

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: svcrpc: gss: fix failure on SVC_DENIED in integrity case
J.Bruce Fields [Wed, 4 Oct 2006 09:16:07 +0000 (02:16 -0700)]
[PATCH] knfsd: svcrpc: gss: fix failure on SVC_DENIED in integrity case

If the request is denied after gss_accept was called, we shouldn't try to wrap
the reply.  We were checking the accept_stat but not the reply_stat.

To check the reply_stat in _release, we need a pointer to before (rather than
after) the verifier, so modify body_start appropriately.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: svcrpc: gss: factor out some common wrapping code
J.Bruce Fields [Wed, 4 Oct 2006 09:16:06 +0000 (02:16 -0700)]
[PATCH] knfsd: svcrpc: gss: factor out some common wrapping code

Factor out some common code from the integrity and privacy cases.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Convert lockd to use the newer mutex instead of the older semaphore
Neil Brown [Wed, 4 Oct 2006 09:16:06 +0000 (02:16 -0700)]
[PATCH] Convert lockd to use the newer mutex instead of the older semaphore

Both the (recently introduces) nsm_sema and the older f_sema are converted
over.

Cc: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: register all RPC programs with portmapper by default
Olaf Kirch [Wed, 4 Oct 2006 09:16:05 +0000 (02:16 -0700)]
[PATCH] knfsd: register all RPC programs with portmapper by default

The NFSACL patches introduced support for multiple RPC services listening on
the same transport.  However, only the first of these services was registered
with portmapper.  This was perfectly fine for nfsacl, as you traditionally do
not want these to show up in a portmapper listing.

The patch below changes the default behavior to always register all services
listening on a given transport, but retains the old behavior for nfsacl
services.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: fix use of h_nextrebind
Olaf Kirch [Wed, 4 Oct 2006 09:16:04 +0000 (02:16 -0700)]
[PATCH] knfsd: lockd: fix use of h_nextrebind

nlmclnt_recovery would try to force a portmap rebind by setting
host->h_nextrebind to 0.  The right thing to do here is to set it to the
current time.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: export nsm_local_state to user space via sysctl
Olaf Kirch [Wed, 4 Oct 2006 09:16:03 +0000 (02:16 -0700)]
[PATCH] knfsd: export nsm_local_state to user space via sysctl

Every NLM call includes the client's NSM state.  Currently, the Linux client
always reports 0 - which seems not to cause any problems, but is not what the
protocol says.

This patch exposes the kernel's internal variable to user space via a sysctl,
which can be set at system boot time by statd.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: match GRANTED_RES replies using cookies
Olaf Kirch [Wed, 4 Oct 2006 09:16:03 +0000 (02:16 -0700)]
[PATCH] knfsd: match GRANTED_RES replies using cookies

When we send a GRANTED_MSG call, we current copy the NLM cookie provided in
the original LOCK call - because in 1996, some broken clients seemed to rely
on this bug.  However, this means the cookies are not unique, so that when the
client's GRANTED_RES message comes back, we cannot simply match it based on
the cookie, but have to use the client's IP address in addition.  Which breaks
when you have a multi-homed NFS client.

The X/Open spec explicitly mentions that clients should not expect the same
cookie; so one may hope that any clients that were broken in 1996 have either
been fixed or rendered obsolete.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: make nlmclnt_next_cookie SMP safe
Olaf Kirch [Wed, 4 Oct 2006 09:16:02 +0000 (02:16 -0700)]
[PATCH] knfsd: make nlmclnt_next_cookie SMP safe

The way we incremented the NLM cookie in nlmclnt_next_cookie was not thread
safe.  This patch changes the counter to an atomic_t

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: optionally use hostnames for identifying peers
Olaf Kirch [Wed, 4 Oct 2006 09:16:01 +0000 (02:16 -0700)]
[PATCH] knfsd: lockd: optionally use hostnames for identifying peers

This patch adds the nsm_use_hostnames sysctl and module param.  If set, lockd
will use the client's name (as given in the NLM arguments) to find the NSM
handle.  This makes recovery work when the NFS peer is multi-homed, and the
reboot notification arrives from a different IP than the original lock calls.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: simplify nlmsvc_invalidate_all
NeilBrown [Wed, 4 Oct 2006 09:16:00 +0000 (02:16 -0700)]
[PATCH] knfsd: simplify nlmsvc_invalidate_all

As a result of previous patches, the loop in nlmsvc_invalidate_all just sets
h_expires for all client/hosts to 0 (though does it in a very complicated
way).

This was possibly meant to trigger early garbage collection but half the time
'0' is in the future and so it infact delays garbage collection.

Pre-aging the 'hosts' is not really needed at this point anyway so we throw
out the loop and nlm_find_client which is no longer needed.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: Add nlm_destroy_host
Olaf Kirch [Wed, 4 Oct 2006 09:16:00 +0000 (02:16 -0700)]
[PATCH] knfsd: lockd: Add nlm_destroy_host

This patch moves the host destruction code out of nlm_host_gc into a function
of its own.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: make nlm_traverse_* more flexible
Olaf Kirch [Wed, 4 Oct 2006 09:15:59 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: make nlm_traverse_* more flexible

This patch makes nlm_traverse{locks,blocks,shares} and friends use a function
pointer rather than a "action" enum.

This function pointer is given two nlm_hosts (one given by the caller, the
other taken from the lock/block/share currently visited), and is free to do
with them as it wants.  If it returns a non-zero value, the lockd/block/share
is released.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: change nlm_file to use a hlist
Olaf Kirch [Wed, 4 Oct 2006 09:15:58 +0000 (02:15 -0700)]
[PATCH] knfsd: change nlm_file to use a hlist

This changes struct nlm_file and the nlm_files hash table to use a hlist
instead of the home-grown lists.

This allows us to remove f_hash which was only used to find the right hash
chain to delete an entry from.

It also increases the size of the nlm_files hash table from 32 to 128.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: Change list of blocked list to list_node
Olaf Kirch [Wed, 4 Oct 2006 09:15:57 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: Change list of blocked list to list_node

This patch changes the nlm_blocked list to use a list_node instead of
homegrown linked list handling.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: make the hash chains use a hlist_node
Olaf Kirch [Wed, 4 Oct 2006 09:15:56 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: make the hash chains use a hlist_node

Get rid of the home-grown singly linked lists for the nlm_host hash table.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: make the nsm upcalls use the nsm_handle
Olaf Kirch [Wed, 4 Oct 2006 09:15:56 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: make the nsm upcalls use the nsm_handle

This converts the statd upcalls to use the nsm_handle

This means that we only register each host once with statd, rather than
registering each host/vers/protocol triple.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: Make nlm_host_rebooted use the nsm_handle
Olaf Kirch [Wed, 4 Oct 2006 09:15:55 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: Make nlm_host_rebooted use the nsm_handle

This patch makes the SM_NOTIFY handling understand and use the nsm_handle.

To make it a bit clear what is happening:

    nlmclent_prepare_reclaim and nlmclnt_finish_reclaim
    get open-coded into 'reclaimer'

The result is tidied up.

Then some of that functionality is moved out into nlm_host_rebooted (which
calls nlmclnt_recovery which starts a thread which runs reclaimer).

Also host_rebooted now finds an nsm_handle rather than a host, then then
iterates over all hosts and deals with each host that shares that nsm_handle.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: misc minor fixes, indentation changes
Olaf Kirch [Wed, 4 Oct 2006 09:15:54 +0000 (02:15 -0700)]
[PATCH] knfsd: misc minor fixes, indentation changes

cleans up some code in lockd/host.c, fixes an error printk and makes it a
fatal BUG if nlmsvc_free_host_resources fails.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: lockd: introduce nsm_handle
Olaf Kirch [Wed, 4 Oct 2006 09:15:53 +0000 (02:15 -0700)]
[PATCH] knfsd: lockd: introduce nsm_handle

This patch introduces the nsm_handle, which is shared by all nlm_host objects
referring to the same client.

With this patch applied, all nlm_hosts from the same address will share the
same nsm_handle.  A future patch will add sharing by name.

Note: this patch changes h_name so that it is no longer guaranteed to be an IP
address of the host.  When the host represents an NFS server, h_name will be
the name passed in the mount call.  When the host represents a client, h_name
will be the name presented in the lock request received from the client.  A
h_name is only used for printing informational messages, this change should
not be significant.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: when looking up a lockd host, pass hostname & length
Olaf Kirch [Wed, 4 Oct 2006 09:15:52 +0000 (02:15 -0700)]
[PATCH] knfsd: when looking up a lockd host, pass hostname & length

This patch adds the peer's hostname (and name length) to all calls to
nlm*_lookup_host functions.  A subsequent patch will make use of these (is
requested by a sysctl).

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: consolidate common code for statd->lockd notification
Olaf Kirch [Wed, 4 Oct 2006 09:15:52 +0000 (02:15 -0700)]
[PATCH] knfsd: consolidate common code for statd->lockd notification

Common code from nlm4svc_proc_sm_notify and nlmsvc_proc_sm_notify is moved
into a new nlm_host_rebooted.

This is in preparation of a patch that will change the reboot notification
handling entirely.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: hide use of lockd's h_monitored flag
Olaf Kirch [Wed, 4 Oct 2006 09:15:51 +0000 (02:15 -0700)]
[PATCH] knfsd: hide use of lockd's h_monitored flag

This patch moves all checks of the h_monitored flag into the
nsm_monitor/unmonitor functions.  A subsequent patch will replace the
mechanism by which we mark a host as being monitored.

There is still one occurence of h_monitored outside of mon.c and that is in
clntlock.c where we respond to a reboot.  The subsequent patch will modify
this too.

Signed-off-by: Olaf Kirch <okir@suse.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: knfsd: cache ipmap per TCP socket
Greg Banks [Wed, 4 Oct 2006 09:15:50 +0000 (02:15 -0700)]
[PATCH] knfsd: knfsd: cache ipmap per TCP socket

Speed up high call-rate workloads by caching the struct ip_map for the peer on
the connected struct svc_sock instead of looking it up in the ip_map cache
hashtable on every call.  This helps workloads using AUTH_SYS authentication
over TCP.

Testing was on a 4 CPU 4 NIC Altix using 4 IRIX clients, each with 16
synthetic client threads simulating an rsync (i.e.  recursive directory
listing) workload reading from an i386 RH9 install image (161480 regular files
in 10841 directories) on the server.  That tree is small enough to fill in the
server's RAM so no disk traffic was involved.  This setup gives a sustained
call rate in excess of 60000 calls/sec before being CPU-bound on the server.

Profiling showed strcmp(), called from ip_map_match(), was taking 4.8% of each
CPU, and ip_map_lookup() was taking 2.9%.  This patch drops both contribution
into the profile noise.

Note that the above result overstates this value of this patch for most
workloads.  The synthetic clients are all using separate IP addresses, so
there are 64 entries in the ip_map cache hash.  Because the kernel measured
contained the bug fixed in commit

commit 1f1e030bf75774b6a283518e1534d598e14147d4

and was running on 64bit little-endian machine, probably all of those 64
entries were on a single chain, thus increasing the cost of ip_map_lookup().

With a modern kernel you would need more clients to see the same amount of
performance improvement.  This patch has helped to scale knfsd to handle a
deployment with 2000 NFS clients.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: make nfsd readahead params cache SMP-friendly
Greg Banks [Wed, 4 Oct 2006 09:15:49 +0000 (02:15 -0700)]
[PATCH] knfsd: make nfsd readahead params cache SMP-friendly

Make the nfsd read-ahead params cache more SMP-friendly by changing the single
global list and lock into a fixed 16-bucket hashtable with per-bucket locks.
This reduces spinlock contention in nfsd_read() on read-heavy workloads on
multiprocessor servers.

Testing was on a 4 CPU 4 NIC Altix using 4 IRIX clients each doing 1K
streaming reads at full line rate.  The server had 128 nfsd threads, which
sizes the RA cache at 256 entries, of which only a handful were used.  Flat
profiling shows nfsd_read(), including the inlined nfsd_get_raparms(), taking
10.4% of each CPU.  This patch drops the contribution from nfsd() to 1.71% for
each CPU.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Allow max size of NFSd payload to be configured
NeilBrown [Wed, 4 Oct 2006 09:15:48 +0000 (02:15 -0700)]
[PATCH] knfsd: Allow max size of NFSd payload to be configured

The max possible is the maximum RPC payload.  The default depends on amount of
total memory.

The value can be set within reason as long as no nfsd threads are currently
running.  The value can also be ready, allowing the default to be determined
after nfsd has started.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Prepare knfsd for support of rsize/wsize of up to 1MB, over TCP
Greg Banks [Wed, 4 Oct 2006 09:15:47 +0000 (02:15 -0700)]
[PATCH] knfsd: Prepare knfsd for support of rsize/wsize of up to 1MB, over TCP

The limit over UDP remains at 32K.  Also, make some of the apparently
arbitrary sizing constants clearer.

The biggest change here involves replacing NFSSVC_MAXBLKSIZE by a function of
the rqstp.  This allows it to be different for different protocols (udp/tcp)
and also allows it to depend on the servers declared sv_bufsiz.

Note that we don't actually increase sv_bufsz for nfs yet.  That comes next.

Signed-off-by: Greg Banks <gnb@melbourne.sgi.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Avoid excess stack usage in svc_tcp_recvfrom
NeilBrown [Wed, 4 Oct 2006 09:15:47 +0000 (02:15 -0700)]
[PATCH] knfsd: Avoid excess stack usage in svc_tcp_recvfrom

..  by allocating the array of 'kvec' in 'struct svc_rqst'.

As we plan to increase RPCSVC_MAXPAGES from 8 upto 256, we can no longer
allocate an array of this size on the stack.  So we allocate it in 'struct
svc_rqst'.

However svc_rqst contains (indirectly) an array of the same type and size
(actually several, but they are in a union).  So rather than waste space, we
move those arrays out of the separately allocated union and into svc_rqst to
share with the kvec moved out of svc_tcp_recvfrom (various arrays are used at
different times, so there is no conflict).

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Replace two page lists in struct svc_rqst with one
NeilBrown [Wed, 4 Oct 2006 09:15:46 +0000 (02:15 -0700)]
[PATCH] knfsd: Replace two page lists in struct svc_rqst with one

We are planning to increase RPCSVC_MAXPAGES from about 8 to about 256.  This
means we need to be a bit careful about arrays of size RPCSVC_MAXPAGES.

struct svc_rqst contains two such arrays.  However the there are never more
that RPCSVC_MAXPAGES pages in the two arrays together, so only one array is
needed.

The two arrays are for the pages holding the request, and the pages holding
the reply.  Instead of two arrays, we can simply keep an index into where the
first reply page is.

This patch also removes a number of small inline functions that probably
server to obscure what is going on rather than clarify it, and opencode the
needed functionality.

Also remove the 'rq_restailpage' variable as it is *always* 0.  i.e.  if the
response 'xdr' structure has a non-empty tail it is always in the same pages
as the head.

 check counters are initilised and incr properly
 check for consistant usage of ++ etc
 maybe extra some inlines for common approach
 general review

Signed-off-by: Neil Brown <neilb@suse.de>
Cc: Magnus Maatta <novell@kiruna.se>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Fixed handling of lockd fail when adding nfsd socket
NeilBrown [Wed, 4 Oct 2006 09:15:45 +0000 (02:15 -0700)]
[PATCH] knfsd: Fixed handling of lockd fail when adding nfsd socket

Arrgg..  We cannot 'lockd_up' before 'svc_addsock' as we don't know the
protocol yet....  So switch it around again and save the name of the created
sockets so that it can be closed if lock_up fails.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: Protect update to sn_nrthreads with lock_kernel
NeilBrown [Wed, 4 Oct 2006 09:15:44 +0000 (02:15 -0700)]
[PATCH] knfsd: Protect update to sn_nrthreads with lock_kernel

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: call lockd_down when closing a socket via a write to nfsd/portlist
NeilBrown [Wed, 4 Oct 2006 09:15:44 +0000 (02:15 -0700)]
[PATCH] knfsd: call lockd_down when closing a socket via a write to nfsd/portlist

The refcount that nfsd holds on lockd is based on the number of open sockets.
So when we close a socket, we should decrement the ref (with lockd_down).

Currently when a socket is closed via writing to the portlist file, that
doesn't happen.

So: make sure we get an error return if the socket that was requested does is
not found, and call lockd_down if it was.

Cc: "J. Bruce Fields" <bfields@fieldses.org>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] knfsd: nfsd: lockdep annotation fix
NeilBrown [Wed, 4 Oct 2006 09:15:43 +0000 (02:15 -0700)]
[PATCH] knfsd: nfsd: lockdep annotation fix

nfsv2 needs the I_MUTEX_PARENT on the directory when creating a file too.

Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] hisax niccy cleanup
Jiri Slaby [Wed, 4 Oct 2006 09:15:42 +0000 (02:15 -0700)]
[PATCH] hisax niccy cleanup

Whitespace cleanup, delete unnecesasry parenthesis and braces.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: properly use the new multi block-write error handling
Pierre Ossman [Wed, 4 Oct 2006 09:15:41 +0000 (02:15 -0700)]
[PATCH] mmc: properly use the new multi block-write error handling

Use the new multi block-write error reporting flag and properly tell the block
layer how much data was transferred before the error.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: use own work queue
Pierre Ossman [Wed, 4 Oct 2006 09:15:41 +0000 (02:15 -0700)]
[PATCH] mmc: use own work queue

The MMC layer uses the standard work queue for doing card detection.  As this
queue is shared with other crucial subsystems, the effects of a long (and
perhaps buggy) detection can cause the system to be unusable.  E.g.  the
keyboard stops working while the detection routine is running.

The solution is to add a specific mmc work queue to run the detection code in.
This is similar to how other subsystems handle detection (a full kernel
thread is the most common theme).

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: avoid some resets without card
Pierre Ossman [Wed, 4 Oct 2006 09:15:40 +0000 (02:15 -0700)]
[PATCH] mmc: avoid some resets without card

Some Ricoh controllers only respect a full reset when there is no card in the
slot.  As we wait for the reset to complete, we must avoid even requesting
those resets on the buggy controllers.

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: fix MMIO vs memory races in sdhci
Pierre Ossman [Wed, 4 Oct 2006 09:15:39 +0000 (02:15 -0700)]
[PATCH] mmc: fix MMIO vs memory races in sdhci

Sprinkle some mmiowb() where needed (writeX() before unlock()).

Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: driver for TI FlashMedia card reader - Kconfig/Makefile
Alex Dubov [Wed, 4 Oct 2006 09:15:38 +0000 (02:15 -0700)]
[PATCH] mmc: driver for TI FlashMedia card reader - Kconfig/Makefile

Signed-off-by: Alex Dubov <oakad@yahoo.com>
Cc: Daniel Qarras <dqarras@yahoo.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mmc: driver for TI FlashMedia card reader - source
Alex Dubov [Wed, 4 Oct 2006 09:15:37 +0000 (02:15 -0700)]
[PATCH] mmc: driver for TI FlashMedia card reader - source

Driver for TI Flash Media card reader.  At present, only MMC/SD cards are
supported.

[akpm@osdl.org: cleanups, build fixes]
Signed-off-by: Alex Dubov <oakad@yahoo.com>
Cc: Daniel Qarras <dqarras@yahoo.com>
Acked-by: Pierre Ossman <drzeus@drzeus.cx>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] scx200_hrt: fix precedence bug manifesting as 27x clock in 1 MHz mode
Jim Cromie [Wed, 4 Oct 2006 09:15:35 +0000 (02:15 -0700)]
[PATCH] scx200_hrt: fix precedence bug manifesting as 27x clock in 1 MHz mode

Fix paren-placement / precedence bug breaking initialization for 1 MHz
clock mode.

Also fix comment spelling error, and fence-post (off-by-one) error on
symbol used in request_region.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=7242

Thanks alexander.krause@erazor-zone.de, dzpost@dedekind.net, for the
reports and patch test, and phelps@mantara.com for the independent patch
and verification.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Cc: <alexander.krause@erazor-zone.de>
Cc: <dzpost@dedekind.net>
Cc: <phelps@mantara.com>
Acked-by: John Stultz <johnstul@us.ibm.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fix "PCI: assign ioapic resource at hotplug"
Kenji Kaneshige [Wed, 4 Oct 2006 09:15:34 +0000 (02:15 -0700)]
[PATCH] fix "PCI: assign ioapic resource at hotplug"

Roland Dreier wrote:
> The change "PCI: assign ioapic resource at hotplug" (commit
23186279658cea6d42a050400d3e79c56cb459b4 in Linus's tree) makes
> networking stop working on my system (SuperMicro H8QC8 with four
> dual-core Opteron 885 CPUs).  In particular, the on-board NIC stops
> working, probably because it gets assigned the wrong IRQ (225 in the
> non-working case, 217 in the working case)
>
> With that patch applied, e1000 doesn't work.  Reverting just that
> patch (shown below) from Linus's latest tree fixes things for me.
>

The cause of this problem might be an wrong assumption that the 'start'
member of resource structure for ioapic device has non-zero value if the
resources are assigned by firmware.  The 'start' member of ioapic device
seems not to be set even though the resources were actually assigned to
ioapic devices by firmware.

Cc: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: MUNEDA Takahiro <muneda.takahiro@jp.fujitsu.com>
Cc: Satoru Takeuchi <takeuchi_satoru@jp.fujitsu.com>
Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Roland Dreier <rdreier@cisco.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix spurious error on TAGS target when missing defconfig
David Gibson [Wed, 4 Oct 2006 09:15:32 +0000 (02:15 -0700)]
[PATCH] Fix spurious error on TAGS target when missing defconfig

Not all architectures have a file named 'defconfig' (e.g.  powerpc).
However the make TAGS and make tags targets search such files for tags,
causing an error message when they don't exist.  This patch addresses the
problem by instructing xargs not to run the tags program if there are no
matching files.

Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Remove unnecessary check in fs/reiserfs/inode.c
Eric Sesterhenn [Wed, 4 Oct 2006 09:15:30 +0000 (02:15 -0700)]
[PATCH] Remove unnecessary check in fs/reiserfs/inode.c

Since all callers dereference dir, we dont need this check.  Coverity id
#337.

Signed-off-by: Eric Sesterhenn <snakebyte@gmx.de>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: <reiserfs-dev@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] pktcdvd: rename a variable for better readability
Thomas Maier [Wed, 4 Oct 2006 09:15:30 +0000 (02:15 -0700)]
[PATCH] pktcdvd: rename a variable for better readability

pktcdvd: Rename a variable for better readability.

Signed-off-by: Thomas Maier <balagi@justmail.de>
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] pktcdvd: Replace pktcdvd strings with macro DRIVER_NAME.
Thomas Maier [Wed, 4 Oct 2006 09:15:28 +0000 (02:15 -0700)]
[PATCH] pktcdvd: Replace pktcdvd strings with macro DRIVER_NAME.

pktcdvd: Replace pktcdvd strings with macro DRIVER_NAME.

Signed-off-by: Thomas Maier <balagi@justmail.de>
Signed-off-by: Peter Osterlund <petero2@telia.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Char: serial167, remove useless tty check
Jiri Slaby [Wed, 4 Oct 2006 09:15:28 +0000 (02:15 -0700)]
[PATCH] Char: serial167, remove useless tty check

serial167, remove useless tty check

tty is dereferenced before it is checked to be non-NULL.  Remove such
check.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] char: kill unneeded memsets
Jiri Slaby [Wed, 4 Oct 2006 09:15:27 +0000 (02:15 -0700)]
[PATCH] char: kill unneeded memsets

char, another tmp_buf cleanup

No need to allocate one page as a side buffer.  It's no more used.  Clean this
(de)allocs of this useless memory pages in char subtree.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] slab: clean up leak tracking ifdefs a little bit
Christoph Hellwig [Wed, 4 Oct 2006 09:15:25 +0000 (02:15 -0700)]
[PATCH] slab: clean up leak tracking ifdefs a little bit

- rename ____kmalloc to kmalloc_track_caller so that people have a chance
  to guess what it does just from it's name.  Add a comment describing it
  for those who don't.  Also move it after kmalloc in slab.h so people get
  less confused when they are just looking for kmalloc - move things around
  in slab.c a little to reduce the ifdef mess.

[penberg@cs.helsinki.fi: Fix up reversed #ifdef]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] page_alloc: fix kernel-doc and func. declaration
Randy Dunlap [Wed, 4 Oct 2006 09:15:25 +0000 (02:15 -0700)]
[PATCH] page_alloc: fix kernel-doc and func. declaration

Fix kernel-doc and function declaration (missing "void") in
mm/page_alloc.c.

Add mm/page_alloc.c to kernel-api.tmpl in DocBook.

mm/page_alloc.c:2589:38: warning: non-ANSI function declaration of function 'remove_all_active_ranges'

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] enforce proper tlb flush in unmap_hugepage_range
Chen, Kenneth W [Wed, 4 Oct 2006 09:15:24 +0000 (02:15 -0700)]
[PATCH] enforce proper tlb flush in unmap_hugepage_range

Spotted by Hugh that hugetlb page is free'ed back to global pool before
performing any TLB flush in unmap_hugepage_range().  This potentially allow
threads to abuse free-alloc race condition.

The generic tlb gather code is unsuitable to use by hugetlb, I just open
coded a page gathering list and delayed put_page until tlb flush is
performed.

Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Acked-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mm: micro optimise zone_watermark_ok
Nick Piggin [Wed, 4 Oct 2006 09:15:23 +0000 (02:15 -0700)]
[PATCH] mm: micro optimise zone_watermark_ok

Having min be a signed quantity means gcc can't turn high latency divides
into shifts.  There happen to be two such divides for GFP_ATOMIC (ie.
networking, ie.  important) allocations, one of which depends on the other.
 Fixing this makes code smaller as a bonus.

Shame on somebody (probably me).

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mm: fix in kerneldoc
Henrik Kretzschmar [Wed, 4 Oct 2006 09:15:22 +0000 (02:15 -0700)]
[PATCH] mm: fix in kerneldoc

Fixes an kerneldoc error.

Signed-off-by: Henrik Kretzschmar <henne@nachtwindheim.de>
Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
Acked-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] docs: small kbuild cleanup
Daniel Walker [Wed, 4 Oct 2006 09:15:21 +0000 (02:15 -0700)]
[PATCH] docs: small kbuild cleanup

While reading this I noticed that the contents of this document list
section "3.8 Command line dependency" but it doesn't exist in the document.

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] hdrcheck permission fix
Andrew Morton [Wed, 4 Oct 2006 09:15:20 +0000 (02:15 -0700)]
[PATCH] hdrcheck permission fix

Don't require that scripts/hdrcheck.sh be executable - shit happens...

Cc: Sam Ravnborg <sam@ravnborg.org>
Acked-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] ipc: headers_check fix
Cedric Le Goater [Wed, 4 Oct 2006 09:15:19 +0000 (02:15 -0700)]
[PATCH] ipc: headers_check fix

Fix headers_check #ifdef __KERNEL__ stuff.

Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
All-the-fault-of: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PARISC] Kill wall_jiffies use
Andrew Morton [Sun, 1 Oct 2006 20:17:13 +0000 (16:17 -0400)]
[PARISC] Kill wall_jiffies use

wall_jiffies and jiffies are now equal, so this is a noop...

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Honour "panic_on_oops" sysctl
Helge Deller [Sat, 30 Sep 2006 13:45:58 +0000 (15:45 +0200)]
[PARISC] Honour "panic_on_oops" sysctl

Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Fix fs/binfmt_som.c
Matthew Wilcox [Sun, 24 Sep 2006 19:35:50 +0000 (13:35 -0600)]
[PARISC] Fix fs/binfmt_som.c

Fix compilation (missing include of a.out.h)
Fix security hole (need to call unshare_files)

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Export clear_user_page to modules
Matthew Wilcox [Thu, 21 Sep 2006 03:44:09 +0000 (21:44 -0600)]
[PARISC] Export clear_user_page to modules

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Make DMA routines more stubby
Matthew Wilcox [Thu, 21 Sep 2006 02:36:42 +0000 (20:36 -0600)]
[PARISC] Make DMA routines more stubby

We were pretending to use the GENERIC_ISA_DMA routines, but never
selected that symbol.  Since ISA DMA is known to not work right now,
just remove the attempts to acquire the dma_spin_lock to fix compile
warnings.

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Define pci_get_legacy_ide_irq
Matthew Wilcox [Wed, 20 Sep 2006 01:37:09 +0000 (19:37 -0600)]
[PARISC] Define pci_get_legacy_ide_irq

We can compile at least one IDE driver that refers to this.  We can't
use the asm-generic file because we have our own definitions of
pcibios_resource_to_bus etc.

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Fix CONFIG_DEBUG_SPINLOCK
Matthew Wilcox [Wed, 20 Sep 2006 01:32:42 +0000 (19:32 -0600)]
[PARISC] Fix CONFIG_DEBUG_SPINLOCK

Joel Soete points out that we refer to pa_tlb_lock but only define it if
CONFIG_SMP which breaks a uniprocessor build with CONFIG_DEBUG_SPINLOCK
enabled.  No module refers to pa_tlb_lock, so we can delete the export.

Signed-off-by: Matthew Wilcox <willy@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Fix HPUX compat compile with current GCC
Matthew Wilcox [Tue, 19 Sep 2006 22:44:38 +0000 (16:44 -0600)]
[PARISC] Fix HPUX compat compile with current GCC

GCC no longer allows a cast as lvalue; fix the same way fs/readdir.c was

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Fix iounmap compile warning
Matthew Wilcox [Tue, 19 Sep 2006 22:37:01 +0000 (16:37 -0600)]
[PARISC] Fix iounmap compile warning

iounmap's argument needs to be both const and volatile, otherwise we'll
get warnings that we're discarding pointer qualifiers

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Add support for Quicksilver AGPGART
Kyle McMartin [Fri, 25 Aug 2006 01:33:40 +0000 (21:33 -0400)]
[PARISC] Add support for Quicksilver AGPGART

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Move LBA and SBA register defines to the common ropes.h
Kyle McMartin [Fri, 25 Aug 2006 16:28:24 +0000 (12:28 -0400)]
[PARISC] Move LBA and SBA register defines to the common ropes.h

header. This will allow the use of more constants in the
agpgart driver.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Create shared <asm/ropes.h> header
Kyle McMartin [Fri, 25 Aug 2006 01:32:49 +0000 (21:32 -0400)]
[PARISC] Create shared <asm/ropes.h> header

Pull out struct sba_device and struct lba_device into a
common ropes.h header. Also fold the parisc portion of
iosapic.h into this file. (Then delete the useless portion
of iosapic.h)

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Stash the lba_device in its struct device drvdata
Kyle McMartin [Fri, 25 Aug 2006 01:31:41 +0000 (21:31 -0400)]
[PARISC] Stash the lba_device in its struct device drvdata

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Generalize IS_ASTRO et al to take a parisc_device like
Kyle McMartin [Fri, 25 Aug 2006 01:30:19 +0000 (21:30 -0400)]
[PARISC] Generalize IS_ASTRO et al to take a parisc_device like

IS_ELROY. Also remove the useless caching of the
parisc_device_id in struct sba_device.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Pretty print the name of the lba type on kernel boot
Kyle McMartin [Fri, 25 Aug 2006 01:28:58 +0000 (21:28 -0400)]
[PARISC] Pretty print the name of the lba type on kernel boot

(it's pretty useless telling a user they have a whole bunch of
 TR%d.%d LBAs)

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Remove some obsolete comments and I checked that Reo is similar to Ike
Matthew Wilcox [Tue, 12 Sep 2006 11:19:15 +0000 (05:19 -0600)]
[PARISC] Remove some obsolete comments and I checked that Reo is similar to Ike

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Add hardware found in the rp8400
Matthew Wilcox [Tue, 12 Sep 2006 11:17:59 +0000 (05:17 -0600)]
[PARISC] Add hardware found in the rp8400

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Allow nested interrupts
James Bottomley [Sat, 9 Sep 2006 19:36:25 +0000 (12:36 -0700)]
[PARISC] Allow nested interrupts

Our prior mode of operation didn't allow nested interrupts
because it makes the interrupt code much simpler.  However,
nested interrupts are better for latency.

This code uses the EIEM register to simulate level interrupts
and thus achieve nesting.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Further updates to timer_interrupt()
Grant Grundler [Sun, 10 Sep 2006 19:57:55 +0000 (12:57 -0700)]
[PARISC] Further updates to timer_interrupt()

This version (relative to the current tree):
o eliminates "while (ticks_elapsed)" loop. It's not needed.
o drop "ticks_elapsed" completely from timer_interrupt().
o Estimates elapsed cycles (based on HZ) to see which kind of
  math we want to use to calculate "cycles_remainder".
o Fixes a bug where we would loose a tick if we decided
  we wanted to skip one interrupt.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] remove halftick and copy clocktick to local var (gcc can optimize usage)
Grant Grundler [Mon, 4 Sep 2006 20:56:11 +0000 (13:56 -0700)]
[PARISC] remove halftick and copy clocktick to local var (gcc can optimize usage)

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Rewrite timer_interrupt() and gettimeoffset() using "unsigned" math.
Grant Grundler [Sat, 9 Sep 2006 06:29:22 +0000 (23:29 -0700)]
[PARISC] Rewrite timer_interrupt() and gettimeoffset() using "unsigned" math.

It's just a bit easier to follow and timer code is complex enough.

So far, only tested on A500-5x (64-bit SMP), ie: gettimeoffset() code
hasn't been tested at all.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Enable interrupts while spinning
Matthew Wilcox [Fri, 8 Sep 2006 11:43:44 +0000 (05:43 -0600)]
[PARISC] Enable interrupts while spinning

Use the __raw_spin_lock_flags routine so we can take an interrupt while
spinning.  This re-fixes a bug jejb found on 2005-10-20:

CPU0 does a flush_tlb_all holding the vmlist_lock for write.
CPU1 tries a cat of /proc/meminfo which tries to acquire vmlist_lock for read
CPU1 is now spinning with interrupts disabled
CPU0 tries to execute a smp_call_function to flush the local tlb caches
This is now a deadlock because CPU1 is spinning with interrupts disabled and
can never receive the IPI

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Add new function to start local Interval Timer, start_cpu_itimer()
Grant Grundler [Sun, 3 Sep 2006 07:02:16 +0000 (00:02 -0700)]
[PARISC] Add new function to start local Interval Timer, start_cpu_itimer()

I couldn't find where the itimer was getting started for slave CPUs.
CPU 0 (master) itimer was started in time_init() (arch/parisc/kernel/time.c).
start_cpu_itimer() code was striped from time_init().
Slaves now start their itimer in smp_cpu_init().

This is a first step towards making gettimeoffset() work for SMP.
Next step will be to determine the CR16 (cycle counter)
offsets for each CPU relative to the master (CPU 0).

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Prevent processor_probe() from clobbering cpu_data[0]
Grant Grundler [Fri, 1 Sep 2006 21:18:39 +0000 (14:18 -0700)]
[PARISC] Prevent processor_probe() from clobbering cpu_data[0]

processor_probe() shouldn't clobber cpu_data[0]
cpu_data[0].it_value (used by timer_interrupt()) is already set.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Use CONFIG_HZ to determine interval timer rate (aka clock ticks)
Grant Grundler [Fri, 1 Sep 2006 21:50:25 +0000 (14:50 -0700)]
[PARISC] Use CONFIG_HZ to determine interval timer rate (aka clock ticks)

This isn't likely to be causing problems for other bits of
kernel code. I can't find any other user of CONFIG_HZ outside
of arch specific code.

Signed-off-by: Grant Grundler <grundler@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Implement futex_atomic_cmpxchg_inatomic
Carlos O'Donell [Thu, 7 Sep 2006 17:05:17 +0000 (13:05 -0400)]
[PARISC] Implement futex_atomic_cmpxchg_inatomic

Implement trivial futex_atomic_cmpxchg_inatomic for testing.

Signed-off-by: Carlos O'Donell <carlos@systemhalted.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Improve rwlock implementation
Matthew Wilcox [Sat, 2 Sep 2006 13:54:58 +0000 (07:54 -0600)]
[PARISC] Improve rwlock implementation

Rewrite rwlock implementation to avoid various deadlocks in the current
scheme.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] [BUGFIX] nullify branch delay slot of the jump back to
Kyle McMartin [Mon, 28 Aug 2006 19:42:07 +0000 (15:42 -0400)]
[PARISC] [BUGFIX] nullify branch delay slot of the jump back to

intr_restore in intr_do_preempt. This prevents the execution
of an unwanted insn...

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Clean up asm-parisc/serial.h
Matthew Wilcox [Mon, 28 Aug 2006 17:53:30 +0000 (11:53 -0600)]
[PARISC] Clean up asm-parisc/serial.h

Russell King pointed out that asm/serial.h is anachronistic and we were
misusing BASE_BAUD.  So fix BASE_BAUD for PCI 16550 UARTs, move LASI_BASE_BAUD
into 8250_gsc, and fix the obsolete comment about reserving serial port slots.

Signed-off-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Allow overriding personality with sys_personality
Kyle McMartin [Sun, 27 Aug 2006 15:12:13 +0000 (11:12 -0400)]
[PARISC] Allow overriding personality with sys_personality

And now suddenly, linux32 works on parisc...

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Switch is_compat_task to use TIF_32BIT
Kyle McMartin [Sun, 27 Aug 2006 15:04:26 +0000 (11:04 -0400)]
[PARISC] Switch is_compat_task to use TIF_32BIT

Stop using PER_LINUX32 to designate processes needing
compaterizing. Convert is_compat_task to use TIF_32BIT and
set TIF_32BIT in binfmt_elf32.c

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Prevent multiple includes of asm-parisc/parisc-device.h
Kyle McMartin [Sat, 16 Sep 2006 18:38:22 +0000 (14:38 -0400)]
[PARISC] Prevent multiple includes of asm-parisc/parisc-device.h

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] parisc specific kmap API implementation for pa8800
James Bottomley [Wed, 23 Aug 2006 16:00:04 +0000 (09:00 -0700)]
[PARISC] parisc specific kmap API implementation for pa8800

This patch fixes the pa8800 at a gross level (there are still other
subtle incoherency issues which can still cause crashes and HPMCs).

What it does is try to force eject inequivalent aliases before they
become visible to the L2 cache (which is where we get the incoherence
problems).

A new function (parisc_requires_coherency) is introduced in
asm/processor.h to identify the pa8x00 processors (8800 and 8900)
which have the issue.

Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Document that D-class can also use serial_mux
Carlos O'Donell [Sat, 16 Sep 2006 18:35:51 +0000 (14:35 -0400)]
[PARISC] Document that D-class can also use serial_mux

Signed-off-by: Carlos O'Donell <carlos@systemhalted.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
17 years ago[PARISC] Fix up parisc irq handling for genirq changes
Kyle McMartin [Mon, 14 Aug 2006 02:25:45 +0000 (22:25 -0400)]
[PARISC] Fix up parisc irq handling for genirq changes

Clean up enough to get things compiling again in the interim.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>