Re: [PATCH] uprobes: Improve the usage of xol slots for better scalability

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Liao Chang <liaochang1@xxxxxxxxxx> writes:
> +
> +/*
> + * xol_recycle_insn_slot - recycle a slot from the garbage collection list.
> + */
> +static int xol_recycle_insn_slot(struct xol_area *area)
> +{
> +	struct uprobe_task *utask;
> +	int slot = UINSNS_PER_PAGE;
> +
> +	rcu_read_lock();
> +	list_for_each_entry_rcu(utask, &area->gc_list, gc) {
> +		/*
> +		 * The utask associated slot is in-use or recycling when
> +		 * utask associated slot_ref is not one.
> +		 */
> +		if (test_and_put_task_slot(utask)) {
> +			slot = utask->insn_slot;
> +			utask->insn_slot = UINSNS_PER_PAGE;
> +			clear_bit(slot, area->bitmap);
> +			atomic_dec(&area->slot_count);
> +			get_task_slot(utask);

Doesn't this need some annotation to make ThreadSanitizer happy?
Would be good to have some commentary why doing so
many write operations with merely a rcu_read_lock as protection is safe.
It might be safer to put some write type operations under a real lock. 
Also it is unclear how the RCU grace period for utasks is enforced.


-Andi




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux