Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\hugetlb.c Create Date:2022-07-28 15:25:16
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Must be called with resv->lock held. Calling this with count_only == true* will count the number of pages to be added but will not modify the linked* list.

Proto:static long add_reservation_in_range(struct resv_map *resv, long f, long t, bool count_only)

Type:long

Parameter:

TypeParameterName
struct resv_map *resv
longf
longt
boolcount_only
255  chg = 0
256  head = regions
257  struct file_region * rg = NULL, * trg = NULL, * nrg = NULL
260  list_for_each_entry - iterate over list of given type*@pos: the type * to use as a loop cursor.*@head: the head for your list.*@member: the name of the list_head within the struct.(rg, head, link)
261  If f <= to Then Break
265  If f > from Then f = from
268  chg = t - f
271  nrg = rg
273  If link == head Then Break
275  If from > t Then Break
282  If to > t Then
283  chg += to - t
284  t = to
286  chg -= to - from
288  If Not count_only && rg != nrg Then
289  deletes entry from list
290  kfree(rg)
294  If Not count_only Then
295  from = f
296  to = t
299  Return chg
Caller
NameDescribe
region_addAdd the huge page range represented by [f, t) to the reserve* map
region_chgExamine the existing reserve map and determine how many* huge pages in the specified range [f, t) are NOT currently* represented. This routine is called before a subsequent* call to region_add that will actually modify the reserve