| Age | Commit message (Collapse) | Author |
|
The attached patch moves the IRQ-related SA_xxx flags (namely, SA_PROBE,
SA_SAMPLE_RANDOM and SA_SHIRQ) from all the arch-specific headers to
linux/signal.h. This looks like a left-over after the irq-handling code
was consolidated. The code was moved to kernel/irq/*, but the flags are
still left per-arch.
Right now, adding a new IRQ flag to the arch-specific header, like this
patch does:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/alsa/alsa-driver/utils/patches/pcsp-kernel-2.6.10-03.diff?rev=1.1
no longer works, it breaks the compilation for all other arches, unless you
add that flag to all the other arch-specific headers too. So I think such
a clean-up makes sense.
Signed-off-by: Stas Sergeev <stsp@aknet.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch eliminates all kernel BUGs, trims about 35k off the typical
kernel, and makes the system slightly faster.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
ARM26 define FIRST_USER_ADDRESS as PAGE_SIZE (beyond the machine vectors when
they are mapped low), and use that definition in place of locally defined
MIN_MAP_ADDR. Previously, ARM26 permitted user mappings at 0 if the machine
vectors were mapped high; but that's inconsistent with ARM, and
FIRST_USER_ADDRESS would then have to be determined at runtime. Let's fix it
at PAGE_SIZE throughout the architecture.
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
All the asm*/ipc.h files are basically the same (for things that are used)
so I have consolidated them all into asm-generic/ipc.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Acked-By: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch introduces a new interface function for mapping bus/device memory:
io_remap_pfn_range. This accepts the same parameters as remap_pfn_range and
io_remap_page_range but should be used in any situation where the caller is
not simply remapping ordinary RAM. For example, when mapping device registers
the new function should be used.
The distinction between remapping device memory and ordinary RAM is critical
for the Xen hypervisor.
This patch series also cleans up the remaining users of io_remap_page_range
(in particular, the several sparc-specific sections in various drivers that
use a special form of io_remap_page_range: an extra <iospace> argument for
SPARC arch.) by converting them to use io_remap_pfn_range(), where
io_remap_pfn_range() supports passing <iospace> as part of the pfn argument.
The sparc32 & sparc64 code needs live testing.
(from Keir:)
I have audited the drivers/ and sound/ directories. Most uses of
remap_pfn_range are okay, but there are a small handful that are remapping
device memory (mostly AGP and DRM drivers).
Of particular driver is the HPET driver, whose mmap function is broken even
for native (non-Xen) builds. If nothing else, vmalloc_to_phys should be used
instead of __pa to convert an ioremapped virtual address to a valid physical
address. The fix in this patch is to remember the original bus address as
probed at boot time and to pass this to io_remap_pfn_range.
io_remap_pfn_range():
add io_remap_pfn_range() for all arches;
add MK_IOSPACE_PFN(), GET_IOSPACE(), and GET_PFN()
for all arches but primarily for sparc32/64's extended IO space,
sparc: kill the hack of using low bit of <offset> to mean
write_combine or set side-effect (_PAGE_E) bit;
(DaveM suggested that I kill it;)
future: convert remaining callers of io_remap_page_range() to
io_remap_pfn_range() and deprecate io_remap_page_range();
Signed-off-by: Randy Dunlap <rddunlap@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch extracts all the operations on counters protected by the page
table lock (currently rss and anon_rss) into definitions in
include/linux/sched.h. All rss operations are performed through the
following macros:
get_mm_counter(mm, member) -> Obtain the value of a counter
set_mm_counter(mm, member, value) -> Set the value of a counter
update_mm_counter(mm, member, value) -> Add to a counter
inc_mm_counter(mm, member) -> Increment a counter
dec_mm_counter(mm, member) -> Decrement a counter
With this patch it becomes easier to add new counters and it is possible to
redefine the method of counter handling. The counters are an issue for
scalability since they are used in frequently used code paths and may cause
cache line bouncing.
F.e. One may not use counters at all and count the pages when needed, switch
to atomic operations if the mm_struct locking changes or split the rss
into counters that can be locally incremented.
The relevant fields of the task_struct are renamed with a leading underscore
to catch out people who are not using the acceessor macros.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch contains the following cleanups on several architectures:
- make some needlessly global code static
- remove the following write-only (except for printk's) variables:
- cache_decay_ticks
- smp_threads_ready
- cacheflush_time
I've only tried the compilation on i386, but I hope all mistakes I made
are on unimportant architectures. ;-)
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The previous 9 patches should take care of converting all callers of
verify_area into access_ok, so now it's time to deprecate verify_area all over
so noone gets tempted to use it in new code - this patch does that.
Eventually when this has been deprecated for a while I'll send patches to
completely remove the function (thoughts on how long it should be deprecated
first are welcome).
Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Convert /dev/mem read/write calls to use arch_translate_mem_ptr if
available. Needed on ia64 for pages converted fo uncached mappings to
avoid it being accessed in cached mode after the conversion which can lead
to memory corruption. Introduces PG_uncached page flag for marking pages
uncached.
Also folds do_write_mem into write_mem as it was it's only user.
Use __ARCH_HAS_NO_PAGE_ZERO_MAPPED for architectures to indicate they
require magic handling of the zero page (Sparc and m68k).
Signed-off-by: Jes Sorensen <jes@wildopensource.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The current cond_syscall #defines add a semicolon on the end, and then
folks leave the semicolons off in kernel/sys_ni.c, which confuses editors
that are language-aware and is just generally bad style. This sweeps all
the users and makes sys_ni.c look like normal C code.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
into ppc970.osdl.org:/home/torvalds/v2.6/linux
|
|
into picasso.davemloft.net:/home/davem/src/BK/flush_cache_page-2.6
|
|
into picasso.davemloft.net:/home/davem/src/BK/set_pte-2.6
|
|
The patch below replaces the existing 8Kb randomisation of the userspace stack
pointer (which is currently only done for Hyperthreaded P-IVs) with a more
general randomisation over a 64Kb range. 64Kb is not a lot, but it's a start
and once the dust settles we can increase this value to a more agressive
value.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Based almost entirely upon a patch by Russell King.
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
I'm taking a slightly different approach this time around so things
are easier to integrate. Here is the first patch which builds the
infrastructure. Basically:
1) Add set_pte_at() which is set_pte() with 'mm' and 'addr' arguments
added. All generic code uses set_pte_at().
Most platforms simply get this define:
#define set_pte_at(mm,addr,ptep,pteval) set_pte(ptep,pteval)
I chose this method over simply changing all set_pte() call sites
because many platforms implement this in assembler and it would
take forever to preserve the build and stabilize things if modifying
that was necessary.
Soon, with platform maintainer's help, we can kill of set_pte() entirely.
To be honest, there are only a handful of set_pte() call sites in the
arch specific code.
Actually, in this patch ppc64 is completely set_pte() free and does not
define it.
2) pte_clear() gets 'mm' and 'addr' arguments now.
This had a cascading effect on many ptep_test_and_*() routines. Specifically:
a) ptep_test_and_clear_{young,dirty}() now take 'vma' and 'address' args.
b) ptep_get_and_clear now take 'mm' and 'address' args.
c) ptep_mkdirty was deleted, unused by any code.
d) ptep_set_wrprotect now takes 'mm' and 'address' args.
I've tested this patch as follows:
1) compile and run tested on sparc64/SMP
2) compile tested on:
a) ppc64/SMP
b) i386 both with and without PAE enabled
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
Convert the unsafe signed (16bit) used_math to a safe and optimal
PF_USED_MATH
I might have broken arm, see the very first change in the patch to
asm-offsets.c, rest looks ok at first glance.
If you want used_math to return 0 or 1 (instead of 0 or PF_USED_MATH), just
s/!!// in the below patch and place !! in sched.h::*used_math()
accordingly after applying the patch, it should work just fine. Using !!
only when necessary as the below is optimal.
From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
This patch had fixed restore_sigcontext/restore_sigcontext32 about MIPS.
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Signed-off-by: Andrea Arcangeli <andrea@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This makes memdie a TIF_MEMDIE.
memdie will not be modified by the current task, so it cannot be a
PF_MEMDIE but it must be a TIF_MEMDIE.
Signed-off-by: Andrea Arcangeli <andrea@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Most of the include/asm-*/resource.h headers are the same as one another.
This patch makes one generic version, include/asm-generic/resource.h, and
uses that when appropriate. The only vaguely interesting things here are
that the generic version introduces a new _STK_LIM_MAX macro, which can be
populated by an arch (ia64 and parisc needed that). Also, some arches hid
RLIM_INFINITY under __KERNEL__, while others did not. The generic version
does not, so the following arches will see that change:
arm, arm26, mips, ppc, ppc64, sh (and hence sh64)
And, finally, some arches maintain their own order for the resource
numbers. This is now marked by __ARCH_RLIMIT_ORDER, and is used by the
following arches:
alpha, mips, sparc, and sparc64.
This actually uncovered a mips bug (fix already sent, this patch is
relative to that fix), where the default RLIMIT_MEMLOCK was set to
RLIM_INFINITY and RLIMIT_NPROC set to MLOCK_LIMIT (the latter is no big
deal because RLIMIT_NPROC default is overwritten dynamically during bootup
in fork_init()). Also, this change makes alpha's default for RLIMIT_NPROC
change from RLIM_INFINITY to 0, but again...no problem as it's dynamically
overwritten during bootup.
The following arches are left untouched:
m68knommu: untouched (uses m68k/resource.h)
sh64: untouched (uses asm-sh/resource.h)
um: untouched (uses arch code already)
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch introduces the concept of (virtual) cputime. Each architecture
can define its method to measure cputime. The main idea is to define a
cputime_t type and a set of operations on it (see asm-generic/cputime.h).
Then use the type for utime, stime, cutime, cstime, it_virt_value,
it_virt_incr, it_prof_value and it_prof_incr and use the cputime operations
for each access to these variables. The default implementation is jiffies
based and the effect of this patch for architectures which use the default
implementation should be neglectible.
There is a second type cputime64_t which is necessary for the kernel_stat
cpu statistics. The default cputime_t is 32 bit and based on HZ, this will
overflow after 49.7 days. This is not enough for kernel_stat (ihmo not
enough for a processes too), so it is necessary to have a 64 bit type.
The third thing that gets introduced by this patch is an additional field
for the /proc/stat interface: cpu steal time. An architecture can account
cpu steal time by calls to the account_stealtime function. The cpu which
backs a virtual processor doesn't spent all of its time for the virtual
cpu. To get meaningful cpu usage numbers this involuntary wait time needs
to be accounted and exported to user space.
From: Hugh Dickins <hugh@veritas.com>
The p->signal check in account_system_time is insufficient. If the timer
interrupt hits near the end of exit_notify, after EXIT_ZOMBIE has been set,
another cpu may release_task (NULLifying p->signal) in between
account_system_time's check and check_rlimit's dereference. Nor should
account_it_prof risk send_sig. But surely account_user_time is safe?
Signed-off-by: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Remove nowhere referenced file. (egrep "filename\." didn't find anything)
Signed-off-by: Domen Puncer <domen@coderock.org>
Signed-off-by: Ian Molton <spyro@f2s.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The only common field in irq_cpustat is __softirq_pending, i386 and ppc
have some of their own.
Remove all unused obsolete fields from various architectures.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Some long overdue updates to this file. newer macros taken from arm32.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Better put_user macro.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
A keep-it-compiling patch based on the arm32 code.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The arm26 version of this had become horribly out of date. this is a
sideways-port of the arm32 version, dropping the unwanted stuff and adjusted
for arm26 compatability.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
New irq exit handler (part of the softirq changes)
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This diff effects a restructuring of arm26s directory layout. A number of
files can now move to more logical locations, since there are no machine
specific directories anymore.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Various trivial fixes required to get a clean compile.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add and update comments all throughout the arm26 tree.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Replace the macros for atomic ops and bring arm26 up to current definitions.
make the arm26 mm code use the proper macros also.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add a temporary "fallback" header so architectures can run with the 4level
patgetables patch without modification. All architectures should be
converted to use the folding headers (include/asm-generic/pgtable-nop?d.h)
as soon as possible, and the fallback header removed.
Make all architectures include the fallback header, except i386, because that
architecture has earlier been converted to use pgtable-nopmd.h under the 3
level system, which is not compatible with the fallback header.
Signed-off-by: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
- Move MCA_bus declaration from <asm/processor.h> to <linux/mca.h>
- Define it in mca.c, not setup.c
- EXPORT_SYMBOL it at the site of its definition.
- Fix up random files to include <linux/mca.h> for the use of the MCA_bus
symbol
- Delete some unnecessary ifdefs.
- Delete some unneeded comments.
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
|
|
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
PREEMPT_BITS, SOFTIRQ_BITS, PREEMPT_SHIFT, SOFTIRQ_SHIFT and HARDIRQ_SHIFT
are the same for all architectures (and chaning them in future ports
doesn't make a lot of sense), so move them to <linux/hardirq.h>.
Make the HARDIRQ_BITS definition guarded by #ifndef HARDIRQ_BITS instead of
CONFIG_GENERIC_HARDIRQS so we have a saner way to override it once ports
with lots of irq sources are changed to use the generic hardirq framework.
Ingo, maybe we should change the default for it back to 8 as that's what
most ports use?
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
On some platforms (e.g. SGI Challenge, Origin, and Altix machines), writes
to I/O space aren't ordered coming from different CPUs. For the most part,
this isn't a problem since drivers generally spinlock around code that does
writeX calls, but if the last operation a driver does before it releases a
lock is a write and some other CPU takes the lock and immediately does a
write, it's possible the second CPU's write could arrive before the
first's.
This patch adds a mmiowb() call to deal with this sort of situation, and
adds some documentation describing I/O ordering issues to
deviceiobook.tmpl. The idea is to mirror the regular, cacheable memory
barrier operation, wmb. Example of the problem this new macro solves:
CPU A: spin_lock_irqsave(&dev_lock, flags)
CPU A: ...
CPU A: writel(newval, ring_ptr);
CPU A: spin_unlock_irqrestore(&dev_lock, flags)
...
CPU B: spin_lock_irqsave(&dev_lock, flags)
CPU B: writel(newval2, ring_ptr);
CPU B: ...
CPU B: spin_unlock_irqrestore(&dev_lock, flags)
In this case, newval2 could be written to ring_ptr before newval. Fixing
it is easy though:
CPU A: spin_lock_irqsave(&dev_lock, flags)
CPU A: ...
CPU A: writel(newval, ring_ptr);
CPU A: mmiowb(); /* ensure no other writes beat us to the device */
CPU A: spin_unlock_irqrestore(&dev_lock, flags)
...
CPU B: spin_lock_irqsave(&dev_lock, flags)
CPU B: writel(newval2, ring_ptr);
CPU B: ...
CPU B: mmiowb();
CPU B: spin_unlock_irqrestore(&dev_lock, flags)
Note that this doesn't address a related case where the driver may want to
actually make a given write get to the device before proceeding. This
should be dealt with by immediately reading a register from the card that
has no side effects. According to the PCI spec, that will guarantee that
all writes have arrived before being sent to the target bus. If no such
register is available (in the case of card resets perhaps), reading from
config space is sufficient (though it may return all ones if the card isn't
responding to read cycles). I've tried to describe how mmiowb() differs
from PCI posted write flushing in the patch to deviceiobook.tmpl.
Signed-off-by: Jesse Barnes <jbarnes@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
remap_pfn_range()
This patch converts uses of remap_page_range() via io_remap_page_range() in
include/asm-*/ to use remap_pfn_range(). io_remap_page_range() has a similar
physical address overflow issue that needs to be addressed later.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch implements atomic_inc_return() and so on for ARM26. Because
Hugh says that SMP is not supported in arm26, it is implemented by normal
operations between local_irq_save() and local_irq_restore() like another
atomic operations.
Signed-off-by: KaiGai, Kohei <kaigai@ak.jp.nec.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Since the irq handling rework in 2.5 lots of code in the individual
<asm/hardirq.h> files is the same. This patch moves that common code
to <linux/hardirq.h>. The following differences existed:
- alpha, m68k, m68knommu and v850 were missing the ~PREEMPT_ACTIVE
masking in the CONFIG_PREEMPT case of in_atomic(). These
architectures don't support CONFIG_PREEMPT else this would have been
an easily-spottbale bug
- S390 didn't provide synchronize_irq as it doesn't fit into their
I/O model. They now get a spurious prototype/macro
- ppc added a new preemptible() macro that is provided for all
architectures now.
Most drivers were using <linux/interrupt.h> as they should, but a few
drivers and lots of architecture code has been updated to use
<linux/hardirq.h> instead of <asm/hardirq.h>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Every arch defines them the same without exception
and with this we only need to update one spot when
adding new socket types.
Signed-off-by: Arnaldo Carvalho de Melo <acme@conectiva.com.br>
Signed-off-by: David S. Miller <davem@davemloft.net>
|
|
While trying out compiling of reiser4 on sparc64, ppc64, alpha, and ia64, I
discovered that WAITQUEUE_DEBUG is nowhere defined in 2.6.x, and various
compiler versions spew copious warnings at #if on it. Convert
__SEMAPHORE_INITIALIZER() to C99 initializers while in the area.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add a whole bunch more might_sleep() checks. We also enable might_sleep()
checking in copy_*_user(). This was non-trivial because of the "copy_*_user()
in atomic regions" trick would generate false positives. Fix that up by
adding a new __copy_*_user_inatomic(), which avoids the might_sleep() check.
Only i386 is supported in this patch.
With: Arjan van de Ven <arjanv@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
The program counter calculation from pt_regs is the only portion of profile
accounting that differs across various architectures. This is usually
instruction_pointer(regs), but to handle the few arches where it isn't,
introduce profile_pc().
Signed-off-by: William Irwin <wli@holomorphy.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Since various gnupg users have indicated that gpg wants to mlock 32kB of
memory, I created the patch below that increases the default mlock ulimit
to 32kB.
This is no security problem because it's trivial for processes to lock way
more memory than this in page tables, network buffers, etc. In fact, since
this patch allows gnupg to mlock to prevent passphrase data from being
swapped out, the security people will probably like it ;)
This gets the new per-user mlock limit a bit more testing, too.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Here is the last agreed-on patch that lets normal users mlock pages up to
their rlimit. This patch addresses all the issues brought up by Chris and
Andrea.
From: Chris Wright <chrisw@osdl.org>
Couple more nits.
The default lockable amount is one page now (first patch is was 0). Why
don't we keep it as 0, with the CAP_IPC_LOCK overrides in place? That way
nothing is changed from user perspective, and the rest of the policy can be
done by userspace as it should.
This patch breaks in one scenario. When ulimit == 0, process has
CAP_IPC_LOCK, and does SHM_LOCK. The subsequent unlock or destroy will
corrupt the locked_shm count.
It's also inconsistent in handling user_can_mlock/CAP_IPC_LOCK interaction
betwen shm_lock and shm_hugetlb.
SHM_HUGETLB can now only be done by the shm_group or CAP_IPC_LOCK.
Not any can_do_mlock() user.
Double check of can_do_mlock isn't needed in SHM_LOCK path.
Interface names user_can_mlock and user_substract_mlock could be better.
Incremental update below. Ran some simple sanity tests on this plus my
patch below and didn't find any problems.
* Make default RLIM_MEMLOCK limit 0.
* Move CAP_IPC_LOCK check into user_can_mlock to be consistent
and fix but with ulimit == 0 && CAP_IPC_LOCK with SHM_LOCK.
* Allow can_do_mlock() user to try SHM_HUGETLB setup.
* Remove unecessary extra can_do_mlock() test in shmem_lock().
* Rename user_can_mlock to user_shm_lock and user_subtract_mlock
to user_shm_unlock.
* Use user instead of current->user to fit in 80 cols on SHM_LOCK.
Signed-off-by: Rik van Riel <riel@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This moves duplicate BUG, PAGE_BUG, BUG_ON, and WARN_ON code to asm-generic
and makes them slightly more consistent. This cleanup is also preparatory
work for making BUG and WARN verbosity configurable.
Signed-off-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Below is a patch by Hans Ulrich Niedermann
<linux-kernel@n-dimensional.de> to change all references in comments to
files in Documentation/ to start with Documentation/
Signed-off-by: Adrian Bunk <bunk@fs.tum.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
From: Paul Jackson <pj@sgi.com>
With the cpumask rewrite in the previous patch, these various
include/asm-*/cpumask*.h headers are no longer used.
Signed-off-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
This patch adds support for the O_NOATIME open flag (GNU extension):
int O_NOATIME Macro
If this bit is set, read will not update the access time of the file.
See File Times. This is used by programs that do backups, so that
backing a file up does not count as reading it. Only the owner of the
file or the superuser may use this bit.
It is useful if you want to do something with the file atime (for instance,
moving files that have not been accessed in a while to somewhere else, or
something like Debian's popularity-contest) but you also want to read all
files periodically (for instance, tripwire or debsums).
Currently, the program that reads all files periodically has to use utimes,
which can race with the atime update:
A B
open
fstat
read
open
read
close
close
utimes
And the file still has the old atime, instead of the new one from when B
did the read from it. This problem does not happen if A uses O_NOATIME
instead of utimes to preserve the atime.
This patch adds the O_NOATIME constant for all architectures, but it would
also be possible to add it one architecture at a time by defining it to 0
when not defined in asm-*.
Based on patch by Marek Michalkiewicz <marekm@i17linuxb.ists.pwr.wroc.pl> at
http://www.uwsg.iu.edu/hypermail/linux/kernel/9811.2/0118.html
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|
|
Add an rlimit entry to control the maximum number of bytes a user can allocate
to a POSIX mqueue.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
|