Commit 663c5675 authored by Richard Russon's avatar Richard Russon

Merge flatcap.org:/home/flatcap/backup/bk/ntfs-2.6

into flatcap.org:/home/flatcap/backup/bk/ntfs-2.6-devel
parents 50980507 b34cab77
This diff is collapsed.
The Linux kernel supports three overcommit handling modes
The Linux kernel supports the following overcommit handling modes
0 - Heuristic overcommit handling. Obvious overcommits of
address space are refused. Used for a typical system. It
......@@ -7,10 +7,10 @@ The Linux kernel supports three overcommit handling modes
allocate slighly more memory in this mode. This is the
default.
1 - No overcommit handling. Appropriate for some scientific
1 - Always overcommit. Appropriate for some scientific
applications.
2 - (NEW) strict overcommit. The total address space commit
2 - Don't overcommit. The total address space commit
for the system is not permitted to exceed swap + a
configurable percentage (default is 50) of physical RAM.
Depending on the percentage you use, in most situations
......@@ -27,7 +27,7 @@ Gotchas
The C language stack growth does an implicit mremap. If you want absolute
guarantees and run close to the edge you MUST mmap your stack for the
largest size you think you will need. For typical stack usage is does
largest size you think you will need. For typical stack usage this does
not matter much but it's a corner case if you really really care
In mode 2 the MAP_NORESERVE flag is ignored.
......
......@@ -590,7 +590,7 @@ void __init mem_init(void)
* anywhere without overcommit, so turn
* it on by default.
*/
sysctl_overcommit_memory = 1;
sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
}
}
......
......@@ -376,7 +376,7 @@ void __init mem_init(void)
* Turn on overcommit on tiny machines
*/
if (PAGE_SIZE >= 16384 && num_physpages <= 128) {
sysctl_overcommit_memory = 1;
sysctl_overcommit_memory = OVERCOMMIT_ALWAYS;
printk("Turning on overcommit\n");
}
}
......
This diff is collapsed.
......@@ -437,8 +437,9 @@ acpi_numa_arch_fixup (void)
{
int i, j, node_from, node_to;
/* If there's no SRAT, fix the phys_id */
/* If there's no SRAT, fix the phys_id and mark node 0 online */
if (srat_num_cpus == 0) {
node_set_online(0);
node_cpuid[0].phys_id = hard_smp_processor_id();
return;
}
......
......@@ -2286,7 +2286,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, pfm_context_t *ctx, unsigned lon
* if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur)
* return -ENOMEM;
*/
if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -EAGAIN;
if (size > task->rlim[RLIMIT_MEMLOCK].rlim_cur) return -ENOMEM;
/*
* We do the easy to undo allocations first.
......@@ -2601,7 +2601,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task)
*/
if (task == current) return 0;
if (task->state != TASK_STOPPED) {
if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task->pid, task->state));
return -EBUSY;
}
......@@ -4755,7 +4755,7 @@ pfm_check_task_state(pfm_context_t *ctx, int cmd, unsigned long flags)
* the task must be stopped.
*/
if (PFM_CMD_STOPPED(cmd)) {
if (task->state != TASK_STOPPED) {
if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) {
DPRINT(("[%d] task not in stopped state\n", task->pid));
return -EBUSY;
}
......
This diff is collapsed.
......@@ -646,7 +646,7 @@ static void capi_recv_message(struct capi20_appl *ap, struct sk_buff *skb)
kfree_skb(skb);
(void)capiminor_del_ack(mp, datahandle);
if (mp->tty)
tty_wakeup(tty);
tty_wakeup(mp->tty);
(void)handle_minor_send(mp);
} else {
......
......@@ -2673,7 +2673,7 @@ isdn_tty_modem_result(int code, modem_info * info)
if ((info->flags & ISDN_ASYNC_CLOSING) || (!info->tty)) {
return;
}
tty_ldisc_flush(tty);
tty_ldisc_flush(info->tty);
if ((info->flags & ISDN_ASYNC_CHECK_CD) &&
(!((info->flags & ISDN_ASYNC_CALLOUT_ACTIVE) &&
(info->flags & ISDN_ASYNC_CALLOUT_NOHUP)))) {
......
This diff is collapsed.
......@@ -34,6 +34,7 @@
#define SN_SAL_NO_FAULT_ZONE_PHYSICAL 0x02000011
#define SN_SAL_PRINT_ERROR 0x02000012
#define SN_SAL_SET_ERROR_HANDLING_FEATURES 0x0200001a // reentrant
#define SN_SAL_GET_FIT_COMPT 0x0200001b // reentrant
#define SN_SAL_CONSOLE_PUTC 0x02000021
#define SN_SAL_CONSOLE_GETC 0x02000022
#define SN_SAL_CONSOLE_PUTS 0x02000023
......@@ -107,12 +108,13 @@
/*
* SN_SAL_GET_PARTITION_ADDR return constants
* SAL Error Codes
*/
#define SALRET_MORE_PASSES 1
#define SALRET_OK 0
#define SALRET_INVALID_ARG -2
#define SALRET_ERROR -3
#define SALRET_NOT_IMPLEMENTED (-1)
#define SALRET_INVALID_ARG (-2)
#define SALRET_ERROR (-3)
/*
* SN_SAL_SET_ERROR_HANDLING_FEATURES bit settings
......@@ -829,6 +831,34 @@ ia64_sn_irtr_intr_disable(nasid_t nasid, int subch, u64 intr)
return (int) rv.v0;
}
/**
* ia64_sn_get_fit_compt - read a FIT entry from the PROM header
* @nasid: NASID of node to read
* @index: FIT entry index to be retrieved (0..n)
* @fitentry: 16 byte buffer where FIT entry will be stored.
* @banbuf: optional buffer for retrieving banner
* @banlen: length of banner buffer
*
* Access to the physical PROM chips needs to be serialized since reads and
* writes can't occur at the same time, so we need to call into the SAL when
* we want to look at the FIT entries on the chips.
*
* Returns:
* %SALRET_OK if ok
* %SALRET_INVALID_ARG if index too big
* %SALRET_NOT_IMPLEMENTED if running on older PROM
* ??? if nasid invalid OR banner buffer not large enough
*/
static inline int
ia64_sn_get_fit_compt(u64 nasid, u64 index, void *fitentry, void *banbuf,
u64 banlen)
{
struct ia64_sal_retval rv;
SAL_CALL_NOLOCK(rv, SN_SAL_GET_FIT_COMPT, nasid, index, fitentry,
banbuf, banlen, 0, 0);
return (int) rv.status;
}
/*
* Initialize the SAL components of the system controller
* communication driver; specifically pass in a sizable buffer that
......
......@@ -10,6 +10,9 @@
#define MREMAP_MAYMOVE 1
#define MREMAP_FIXED 2
#define OVERCOMMIT_GUESS 0
#define OVERCOMMIT_ALWAYS 1
#define OVERCOMMIT_NEVER 2
extern int sysctl_overcommit_memory;
extern int sysctl_overcommit_ratio;
extern atomic_t vm_committed_space;
......
......@@ -208,6 +208,8 @@ static inline unsigned int jiffies_to_usecs(const unsigned long j)
static inline unsigned long msecs_to_jiffies(const unsigned int m)
{
if (m > jiffies_to_msecs(MAX_JIFFY_OFFSET))
return MAX_JIFFY_OFFSET;
#if HZ <= 1000 && !(1000 % HZ)
return (m + (1000 / HZ) - 1) / (1000 / HZ);
#elif HZ > 1000 && !(HZ % 1000)
......
......@@ -54,7 +54,7 @@ pgprot_t protection_map[16] = {
__S000, __S001, __S010, __S011, __S100, __S101, __S110, __S111
};
int sysctl_overcommit_memory = 0; /* default is heuristic overcommit */
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
atomic_t vm_committed_space = ATOMIC_INIT(0);
......@@ -907,7 +907,7 @@ unsigned long do_mmap_pgoff(struct file * file, unsigned long addr,
return -ENOMEM;
if (accountable && (!(flags & MAP_NORESERVE) ||
sysctl_overcommit_memory > 1)) {
sysctl_overcommit_memory == OVERCOMMIT_NEVER)) {
if (vm_flags & VM_SHARED) {
/* Check memory availability in shmem_file_setup? */
vm_flags |= VM_ACCOUNT;
......
......@@ -30,7 +30,7 @@ unsigned long max_mapnr;
unsigned long num_physpages;
unsigned long askedalloc, realalloc;
atomic_t vm_committed_space = ATOMIC_INIT(0);
int sysctl_overcommit_memory; /* default is heuristic overcommit */
int sysctl_overcommit_memory = OVERCOMMIT_GUESS; /* heuristic overcommit */
int sysctl_overcommit_ratio = 50; /* default is 50% */
int sysctl_max_map_count = DEFAULT_MAX_MAP_COUNT;
......
......@@ -314,10 +314,10 @@ int cap_vm_enough_memory(long pages)
/*
* Sometimes we want to use more memory than we have
*/
if (sysctl_overcommit_memory == 1)
if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS)
return 0;
if (sysctl_overcommit_memory == 0) {
if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
unsigned long n;
free = get_page_cache_size();
......
......@@ -121,10 +121,10 @@ static int dummy_vm_enough_memory(long pages)
/*
* Sometimes we want to use more memory than we have
*/
if (sysctl_overcommit_memory == 1)
if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS)
return 0;
if (sysctl_overcommit_memory == 0) {
if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
free = get_page_cache_size();
free += nr_free_pages();
free += nr_swap_pages;
......
......@@ -1554,10 +1554,10 @@ static int selinux_vm_enough_memory(long pages)
/*
* Sometimes we want to use more memory than we have
*/
if (sysctl_overcommit_memory == 1)
if (sysctl_overcommit_memory == OVERCOMMIT_ALWAYS)
return 0;
if (sysctl_overcommit_memory == 0) {
if (sysctl_overcommit_memory == OVERCOMMIT_GUESS) {
free = get_page_cache_size();
free += nr_free_pages();
free += nr_swap_pages;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment