Re: 回复: [PATCH] debugobjects: install cpu hotplug callback

From: Waiman Long
Date: Tue Aug 25 2020 - 19:32:50 EST


On 8/25/20 6:26 PM, Waiman Long wrote:
On 8/25/20 12:53 AM, Zhang, Qiang wrote:
________________________________________
发件人: linux-kernel-owner@xxxxxxxxxxxxxxx <linux-kernel-owner@xxxxxxxxxxxxxxx> 代表 qiang.zhang@xxxxxxxxxxxxx <qiang.zhang@xxxxxxxxxxxxx>
发送时间: 2020年8月20日 11:24
收件人: tglx@xxxxxxxxxxxxx; elver@xxxxxxxxxx; longman@xxxxxxxxxx
抄送: linux-kernel@xxxxxxxxxxxxxxx
主题: [PATCH] debugobjects: install cpu hotplug callback

From: Zqiang <qiang.zhang@xxxxxxxxxxxxx>

When a cpu going offline, we should free objects in "percpu_obj_pool"
free_objs list which corresponding to this cpu.

The percpu free object pool is supposed to be accessed only by that particular cpu without any lock. Trying to access it from another cpu can cause a race condition unless one can make sure that the offline cpu won't become online in the mean time. There shouldn't be too many free objects in the percpu pool. Is it worth the effort to free them?

Or if you can make the to-be-offlined cpu free the debugobjs before it is offlined. That will work too.

Cheers,
Longman