Re: [PATCH 2/2] uprobes/core: counter to optimize probe hits.
From: Ingo Molnar
Date: Fri Mar 23 2012 - 08:45:29 EST
* Srikar Dronamraju <srikar@xxxxxxxxxxxxxxxxxx> wrote:
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 9ade86e..62d5aeb 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -390,6 +390,7 @@ struct mm_struct {
> struct cpumask cpumask_allocation;
> #endif
> #ifdef CONFIG_UPROBES
> + atomic_t mm_uprobes_count;
> struct uprobes_xol_area *uprobes_xol_area;
> #endif
Since mm_types.h includes uprobes.h already it's much better to
stick this into a 'struct uprobes_state' and thus keep the main
'struct mm_struct' definition as simple as possible.
Also, your patch titles suck:
- no proper capitalization like you can observe with previous
uprobes commits
- extra period at the end
- missing verb from the sentence. Check existing uprobes
commits to see the kind of sentences that commit titles are
expected to be.
> + if (!atomic_read(&uprobe_events) || !valid_vma(vma, false))
> + return; /* Bail-out */
> +
> + if (!atomic_read(&vma->vm_mm->mm_uprobes_count))
> + return;
> +
> + inode = vma->vm_file->f_mapping->host;
> + if (!inode)
> + return;
The 'Bail-out' comment tacked on to one of the returns seems
entirely superfluous.
> + if (vaddr >= vma->vm_start && vaddr < vma->vm_end) {
> +
> + /*
That newline looks superfluous too.
> + return;
> +}
Please read your own patches more carefully ... this should
stick out like a sore thumb.
Some of the above comments apply to your other patch as well.
The structure and granularity of the patches looks good
otherwise.
Thanks,
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/