Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75538
b: refs/heads/master
c: d2c7ddd
h: refs/heads/master
v: v3
  • Loading branch information
David S. Miller committed Jan 17, 2008
1 parent d253608 commit 0f22457
Show file tree
Hide file tree
Showing 21 changed files with 78 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: abde3dff2496d9d44a218cf8e2a17c2383f20b22
refs/heads/master: d2c7ddd6261eb885091cf6ddbcfae01f4216fb8e
23 changes: 23 additions & 0 deletions trunk/Documentation/local_ops.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ long fails. The definition looks like :
typedef struct { atomic_long_t a; } local_t;


* Rules to follow when using local atomic operations

- Variables touched by local ops must be per cpu variables.
- _Only_ the CPU owner of these variables must write to them.
- This CPU can use local ops from any context (process, irq, softirq, nmi, ...)
to update its local_t variables.
- Preemption (or interrupts) must be disabled when using local ops in
process context to make sure the process won't be migrated to a
different CPU between getting the per-cpu variable and doing the
actual local op.
- When using local ops in interrupt context, no special care must be
taken on a mainline kernel, since they will run on the local CPU with
preemption already disabled. I suggest, however, to explicitly
disable preemption anyway to make sure it will still work correctly on
-rt kernels.
- Reading the local cpu variable will provide the current copy of the
variable.
- Reads of these variables can be done from any CPU, because updates to
"long", aligned, variables are always atomic. Since no memory
synchronization is done by the writer CPU, an outdated copy of the
variable can be read when reading some _other_ cpu's variables.


* Rules to follow when using local atomic operations

- Variables touched by local ops must be per cpu variables.
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/alpha/math-emu/math.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc)
FP_UNPACK_SP(SB, &vb);
DR_c = DB_c;
DR_s = DB_s;
DR_e = DB_e + (1024 - 128);
DR_e = DB_e;
DR_f = SB_f << (52 - 23);
goto pack_d;
}
Expand Down
33 changes: 18 additions & 15 deletions trunk/arch/cris/arch-v10/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
*/

#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>


jiffies = jiffies_64;
SECTIONS
{
Expand All @@ -24,7 +23,7 @@ SECTIONS
_stext = .;
__stext = .;
.text : {
TEXT_TEXT
*(.text)
SCHED_TEXT
LOCK_TEXT
*(.fixup)
Expand All @@ -50,10 +49,10 @@ SECTIONS
__edata = . ; /* End of data section */
_edata = . ;

. = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */
. = ALIGN(8192); /* init_task and stack, must be aligned */
.data.init_task : { *(.data.init_task) }

. = ALIGN(PAGE_SIZE); /* Init code and data */
. = ALIGN(8192); /* Init code and data */
__init_begin = .;
.init.text : {
_sinittext = .;
Expand All @@ -67,7 +66,13 @@ SECTIONS
__setup_end = .;
.initcall.init : {
__initcall_start = .;
INITCALLS
*(.initcall1.init);
*(.initcall2.init);
*(.initcall3.init);
*(.initcall4.init);
*(.initcall5.init);
*(.initcall6.init);
*(.initcall7.init);
__initcall_end = .;
}

Expand All @@ -83,18 +88,16 @@ SECTIONS
__initramfs_start = .;
*(.init.ramfs)
__initramfs_end = .;
/* We fill to the next page, so we can discard all init
pages without needing to consider what payload might be
appended to the kernel image. */
FILL (0);
. = ALIGN (8192);
}
#endif

__vmlinux_end = .; /* last address of the physical file */

/*
* We fill to the next page, so we can discard all init
* pages without needing to consider what payload might be
* appended to the kernel image.
*/
. = ALIGN(PAGE_SIZE);

__init_end = .;
__init_end = .;

__data_end = . ; /* Move to _edata ? */
__bss_start = .; /* BSS */
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/sparc64/kernel/sun4v_tlb_miss.S
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ sun4v_itlb_error:

1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
mov %l4, %o1
call sun4v_itlb_error_report
add %sp, PTREGS_OFF, %o0

Expand All @@ -242,7 +241,6 @@ sun4v_dtlb_error:

1: ba,pt %xcc, etrap
2: or %g7, %lo(2b), %g7
mov %l4, %o1
call sun4v_dtlb_error_report
add %sp, PTREGS_OFF, %o0

Expand Down
4 changes: 0 additions & 4 deletions trunk/arch/sparc64/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1950,8 +1950,6 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc);
printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx,
Expand All @@ -1973,8 +1971,6 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl)
printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n",
regs->tpc, tl);
print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc);
printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]);
print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]);
printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] "
"pte[%lx] error[%lx]\n",
sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx,
Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/cpufreq/cpufreq_conservative.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,9 +603,5 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for "
"optimised for use in a battery environment");
MODULE_LICENSE ("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE
fs_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
module_exit(cpufreq_gov_dbs_exit);
5 changes: 1 addition & 4 deletions trunk/drivers/cpufreq/cpufreq_ondemand.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,6 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for "
"Low Latency Frequency Transition capable processors");
MODULE_LICENSE("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND
fs_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
module_exit(cpufreq_gov_dbs_exit);

4 changes: 0 additions & 4 deletions trunk/drivers/cpufreq/cpufreq_userspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,5 @@ MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>, Russell King <rmk@arm.linux.
MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'");
MODULE_LICENSE ("GPL");

#ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE
fs_initcall(cpufreq_gov_userspace_init);
#else
module_init(cpufreq_gov_userspace_init);
#endif
module_exit(cpufreq_gov_userspace_exit);
3 changes: 2 additions & 1 deletion trunk/drivers/media/video/saa7134/saa7134-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1202,8 +1202,9 @@ static int saa7134_suspend(struct pci_dev *pci_dev , pm_message_t state)

static int saa7134_resume(struct pci_dev *pci_dev)
{

struct saa7134_dev *dev = pci_get_drvdata(pci_dev);
unsigned long flags;
unsigned int flags;

pci_restore_state(pci_dev);
pci_set_power_state(pci_dev, PCI_D0);
Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3919,7 +3919,7 @@ e1000_clean(struct napi_struct *napi, int budget)
{
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
struct net_device *poll_dev = adapter->netdev;
int work_done = 0;
int tx_cleaned = 0, work_done = 0;

/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
Expand All @@ -3929,14 +3929,17 @@ e1000_clean(struct napi_struct *napi, int budget)
* simultaneously. A failure obtaining the lock means
* tx_ring[0] is currently being cleaned anyway. */
if (spin_trylock(&adapter->tx_queue_lock)) {
e1000_clean_tx_irq(adapter,
&adapter->tx_ring[0]);
tx_cleaned = e1000_clean_tx_irq(adapter,
&adapter->tx_ring[0]);
spin_unlock(&adapter->tx_queue_lock);
}

adapter->clean_rx(adapter, &adapter->rx_ring[0],
&work_done, budget);

if (tx_cleaned)
work_done = budget;

/* If budget not fully consumed, exit the polling mode */
if (work_done < budget) {
if (likely(adapter->itr_setting & 3))
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/e1000e/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ static int e1000_clean(struct napi_struct *napi, int budget)
{
struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi);
struct net_device *poll_dev = adapter->netdev;
int work_done = 0;
int tx_cleaned = 0, work_done = 0;

/* Must NOT use netdev_priv macro here. */
adapter = poll_dev->priv;
Expand All @@ -1394,12 +1394,15 @@ static int e1000_clean(struct napi_struct *napi, int budget)
* simultaneously. A failure obtaining the lock means
* tx_ring is currently being cleaned anyway. */
if (spin_trylock(&adapter->tx_queue_lock)) {
e1000_clean_tx_irq(adapter);
tx_cleaned = e1000_clean_tx_irq(adapter);
spin_unlock(&adapter->tx_queue_lock);
}

adapter->clean_rx(adapter, &work_done, budget);

if (tx_cleaned)
work_done = budget;

/* If budget not fully consumed, exit the polling mode */
if (work_done < budget) {
if (adapter->itr_setting & 3)
Expand Down
7 changes: 5 additions & 2 deletions trunk/drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1468,13 +1468,16 @@ static int ixgbe_clean(struct napi_struct *napi, int budget)
struct ixgbe_adapter *adapter = container_of(napi,
struct ixgbe_adapter, napi);
struct net_device *netdev = adapter->netdev;
int work_done = 0;
int tx_cleaned = 0, work_done = 0;

/* In non-MSIX case, there is no multi-Tx/Rx queue */
ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring);
ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done,
budget);

if (tx_cleaned)
work_done = budget;

/* If budget not fully consumed, exit the polling mode */
if (work_done < budget) {
netif_rx_complete(netdev, napi);
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/pnp/pnpacpi/rsparser.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res,
} else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of IO "
"resources: %d \n", PNP_MAX_PORT);
warned = 1;
}
}

Expand Down Expand Up @@ -243,7 +242,6 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res,
} else if (!warned) {
printk(KERN_ERR "pnpacpi: exceeded the max number of mem "
"resources: %d\n", PNP_MAX_MEM);
warned = 1;
}
}

Expand Down
4 changes: 0 additions & 4 deletions trunk/drivers/video/modedb.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,10 +259,6 @@ static const struct fb_videomode modedb[] = {
/* 1366x768, 60 Hz, 47.403 kHz hsync, WXGA 16:9 aspect ratio */
NULL, 60, 1366, 768, 13806, 120, 10, 14, 3, 32, 5,
0, FB_VMODE_NONINTERLACED
}, {
/* 1280x800, 60 Hz, 47.403 kHz hsync, WXGA 16:10 aspect ratio */
NULL, 60, 1280, 800, 12048, 200, 64, 24, 1, 136, 3,
0, FB_VMODE_NONINTERLACED
},
};

Expand Down
7 changes: 3 additions & 4 deletions trunk/fs/hfs/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
mapping = tree->inode->i_mapping;
page = read_mapping_page(mapping, 0, NULL);
if (IS_ERR(page))
goto free_inode;
goto free_tree;

/* Load the header */
head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc));
Expand Down Expand Up @@ -99,12 +99,11 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke
page_cache_release(page);
return tree;

fail_page:
fail_page:
page_cache_release(page);
free_inode:
free_tree:
tree->inode->i_mapping->a_ops = &hfs_aops;
iput(tree->inode);
free_tree:
kfree(tree);
return NULL;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,10 @@ handle_t *journal_start(journal_t *journal, int nblocks)
jbd_free_handle(handle);
current->journal_info = NULL;
handle = ERR_PTR(err);
goto out;
}

lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_);

out:
return handle;
}

Expand Down
7 changes: 5 additions & 2 deletions trunk/include/asm-cris/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@
#ifdef __KERNEL__

#include <asm/arch/page.h>
#include <linux/const.h>

/* PAGE_SHIFT determines the page size */
#define PAGE_SHIFT 13
#define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT)
#ifndef __ASSEMBLY__
#define PAGE_SIZE (1UL << PAGE_SHIFT)
#else
#define PAGE_SIZE (1 << PAGE_SHIFT)
#endif
#define PAGE_MASK (~(PAGE_SIZE-1))

#define clear_page(page) memset((void *)(page), 0, PAGE_SIZE)
Expand Down
13 changes: 7 additions & 6 deletions trunk/kernel/kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,11 +451,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
enum umh_wait wait)
{
DECLARE_COMPLETION_ONSTACK(done);
int retval = 0;
int retval;

helper_lock();
if (sub_info->path[0] == '\0')
if (sub_info->path[0] == '\0') {
retval = 0;
goto out;
}

if (!khelper_wq || usermodehelper_disabled) {
retval = -EBUSY;
Expand All @@ -466,14 +468,13 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info,
sub_info->wait = wait;

queue_work(khelper_wq, &sub_info->work);
if (wait == UMH_NO_WAIT) /* task has freed sub_info */
goto unlock;
if (wait == UMH_NO_WAIT) /* task has freed sub_info */
return 0;
wait_for_completion(&done);
retval = sub_info->retval;

out:
out:
call_usermodehelper_freeinfo(sub_info);
unlock:
helper_unlock();
return retval;
}
Expand Down
2 changes: 0 additions & 2 deletions trunk/mm/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
return NULL;
}

#ifdef CONFIG_DEBUG_VM
/*
* Add some anal sanity checks for now. Eventually,
* we should just do "return pfn_to_page(pfn)", but
Expand All @@ -403,7 +402,6 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_
print_bad_pte(vma, pte, addr);
return NULL;
}
#endif

/*
* NOTE! We still have PageReserved() pages in the page
Expand Down
Loading

0 comments on commit 0f22457

Please sign in to comment.