Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
Merge misc fixes from Andrew Morton:
 "10 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  scripts/gdb: fix lx-lsmod refcnt
  omfs: fix potential integer overflow in allocator
  omfs: fix sign confusion for bitmap loop counter
  omfs: set error return when d_make_root() fails
  fs, omfs: add NULL terminator in the end up the token list
  MAINTAINERS: update CAPABILITIES pattern
  fs/binfmt_elf.c:load_elf_binary(): return -EINVAL on zero-length mappings
  tracing/mm: don't trace mm_page_pcpu_drain on offline cpus
  tracing/mm: don't trace mm_page_free on offline cpus
  tracing/mm: don't trace kmem_cache_free on offline cpus
  • Loading branch information
Linus Torvalds committed May 29, 2015
2 parents 6e49ba1 + ca3f172 commit c2102f3
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 18 deletions.
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2427,7 +2427,6 @@ L: linux-security-module@vger.kernel.org
S: Supported
F: include/linux/capability.h
F: include/uapi/linux/capability.h
F: security/capability.c
F: security/commoncap.c
F: kernel/capability.c

Expand Down
2 changes: 1 addition & 1 deletion fs/binfmt_elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -918,7 +918,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
total_size = total_mapping_size(elf_phdata,
loc->elf_ex.e_phnum);
if (!total_size) {
error = -EINVAL;
retval = -EINVAL;
goto out_free_dentry;
}
}
Expand Down
2 changes: 1 addition & 1 deletion fs/omfs/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ int omfs_allocate_range(struct super_block *sb,
goto out;

found:
*return_block = i * bits_per_entry + bit;
*return_block = (u64) i * bits_per_entry + bit;
*return_size = run;
ret = set_run(sb, i, bits_per_entry, bit, run, 1);

Expand Down
10 changes: 7 additions & 3 deletions fs/omfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ static const struct super_operations omfs_sops = {
*/
static int omfs_get_imap(struct super_block *sb)
{
unsigned int bitmap_size, count, array_size;
unsigned int bitmap_size, array_size;
int count;
struct omfs_sb_info *sbi = OMFS_SB(sb);
struct buffer_head *bh;
unsigned long **ptr;
Expand Down Expand Up @@ -359,7 +360,7 @@ static int omfs_get_imap(struct super_block *sb)
}

enum {
Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask
Opt_uid, Opt_gid, Opt_umask, Opt_dmask, Opt_fmask, Opt_err
};

static const match_table_t tokens = {
Expand All @@ -368,6 +369,7 @@ static const match_table_t tokens = {
{Opt_umask, "umask=%o"},
{Opt_dmask, "dmask=%o"},
{Opt_fmask, "fmask=%o"},
{Opt_err, NULL},
};

static int parse_options(char *options, struct omfs_sb_info *sbi)
Expand Down Expand Up @@ -548,8 +550,10 @@ static int omfs_fill_super(struct super_block *sb, void *data, int silent)
}

sb->s_root = d_make_root(root);
if (!sb->s_root)
if (!sb->s_root) {
ret = -ENOMEM;
goto out_brelse_bh2;
}
printk(KERN_DEBUG "omfs: Mounted volume %s\n", omfs_rb->r_name);

ret = 0;
Expand Down
54 changes: 50 additions & 4 deletions include/trace/events/kmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,42 @@ DEFINE_EVENT(kmem_free, kfree,
TP_ARGS(call_site, ptr)
);

DEFINE_EVENT(kmem_free, kmem_cache_free,
DEFINE_EVENT_CONDITION(kmem_free, kmem_cache_free,

TP_PROTO(unsigned long call_site, const void *ptr),

TP_ARGS(call_site, ptr)
TP_ARGS(call_site, ptr),

/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id()))
);

TRACE_EVENT(mm_page_free,
TRACE_EVENT_CONDITION(mm_page_free,

TP_PROTO(struct page *page, unsigned int order),

TP_ARGS(page, order),


/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id())),

TP_STRUCT__entry(
__field( unsigned long, pfn )
__field( unsigned int, order )
Expand Down Expand Up @@ -253,12 +276,35 @@ DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked,
TP_ARGS(page, order, migratetype)
);

DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain,
TRACE_EVENT_CONDITION(mm_page_pcpu_drain,

TP_PROTO(struct page *page, unsigned int order, int migratetype),

TP_ARGS(page, order, migratetype),

/*
* This trace can be potentially called from an offlined cpu.
* Since trace points use RCU and RCU should not be used from
* offline cpus, filter such calls out.
* While this trace can be called from a preemptable section,
* it has no impact on the condition since tasks can migrate
* only from online cpus to other online cpus. Thus its safe
* to use raw_smp_processor_id.
*/
TP_CONDITION(cpu_online(raw_smp_processor_id())),

TP_STRUCT__entry(
__field( unsigned long, pfn )
__field( unsigned int, order )
__field( int, migratetype )
),

TP_fast_assign(
__entry->pfn = page ? page_to_pfn(page) : -1UL;
__entry->order = order;
__entry->migratetype = migratetype;
),

TP_printk("page=%p pfn=%lu order=%d migratetype=%d",
pfn_to_page(__entry->pfn), __entry->pfn,
__entry->order, __entry->migratetype)
Expand Down
9 changes: 1 addition & 8 deletions scripts/gdb/linux/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,18 +73,11 @@ def invoke(self, arg, from_tty):
" " if utils.get_long_type().sizeof == 8 else ""))

for module in module_list():
ref = 0
module_refptr = module['refptr']
for cpu in cpus.cpu_list("cpu_possible_mask"):
refptr = cpus.per_cpu(module_refptr, cpu)
ref += refptr['incs']
ref -= refptr['decs']

gdb.write("{address} {name:<19} {size:>8} {ref}".format(
address=str(module['module_core']).split()[0],
name=module['name'].string(),
size=str(module['core_size']),
ref=str(ref)))
ref=str(module['refcnt']['counter'])))

source_list = module['source_list']
t = self._module_use_type.get_type().pointer()
Expand Down

0 comments on commit c2102f3

Please sign in to comment.