Re: Fix for sys_munlock(2) with racct

看板FB_current作者時間12年前 (2013/08/12 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串5/5 (看更多)
Wiadomo=B6=E6 napisana przez Alan Cox <alc@rice.edu> w dniu 30 lip 2013, o = godz. 19:40: > On Jul 21, 2013, at 2:50 PM, Jeremie Le Hen wrote: >> = >>> Also, a wired mapping can be destroyed by calling munmap(2) without >>> first calling munlock(2), in which case, RACCT_MEMLOCK will be >>> incorrect. >> = >> So I think the right way to tackle this is to handle racct in the vm >> layer rather than at the syscall layer. >> = > = > The VM system already maintains counters equivalent to RACCT_VMEM and RAC= CT_MEMLOCK. They are "map->size" and "pmap_wired_count(map->pmap)". Inste= ad of maintaining duplicate counters, could the resource accounting framewo= rk be extended to support callbacks to obtain a value when it's actually ne= eded? That would be rather hard. The way this works is that raccts are hierarchi= cal, and every time resource allocation is done, its respective counter needs to be propag= ated all the way up. If it hits a limit somewhere, the racct function returns error mea= ning the resource allocation was denied. In other words, racct wants to know when the counte= r changes. _______________________________________________ freebsd-current@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-current To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"
文章代碼(AID): #1I1z5VYl (FB_current)
文章代碼(AID): #1I1z5VYl (FB_current)