diff for duplicates of <20090917091950.GD13002@csn.ul.ie> diff --git a/a/1.txt b/N1/1.txt index 44afddc..f46b3d6 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -17,8 +17,8 @@ On Thu, Sep 17, 2009 at 12:21:42AM +1200, Alexey Korolev wrote: Indeed. -> >> include/linux/hugetlb.h | 3 +++ -> >> mm/hugetlb.c | 23 +++++++++++++++++++++++ +> >> include/linux/hugetlb.h | 3 +++ +> >> mm/hugetlb.c | 23 +++++++++++++++++++++++ > >> 2 files changed, 26 insertions(+) > >> > >> --- @@ -40,7 +40,7 @@ Thanks > >> + * before the page has been faulted. > >> + */ > >> +struct page *hugetlb_get_user_page(struct vm_area_struct *vma, -> >> + unsigned long address) +> >> + unsigned long address) > >> +{ > > > > Your leader and comments say that the function can be used before the pages @@ -69,22 +69,22 @@ page cache lookup and insert instead of a page fault, you could BUG_ON if the page was already in the page cache for example. This would catch already faulted pages as a side-effect. -> >> + int ret; -> >> + int cnt = 1; -> >> + struct page *pg; -> >> + struct hstate *h = hstate_vma(vma); +> >> + int ret; +> >> + int cnt = 1; +> >> + struct page *pg; +> >> + struct hstate *h = hstate_vma(vma); > >> + -> >> + address = address & huge_page_mask(h); -> >> + ret = follow_hugetlb_page(vma->vm_mm, vma, &pg, -> >> + NULL, &address, &cnt, 0, 0); -> >> + if (ret < 0) -> >> + return ERR_PTR(ret); -> >> + put_page(pg); +> >> + address = address & huge_page_mask(h); +> >> + ret = follow_hugetlb_page(vma->vm_mm, vma, &pg, +> >> + NULL, &address, &cnt, 0, 0); +> >> + if (ret < 0) +> >> + return ERR_PTR(ret); +> >> + put_page(pg); > >> + -> >> + return pg; +> >> + return pg; > >> +} > > -> > I think the caller should be responsible for calling put_page(). Otherwise +> > I think the caller should be responsible for calling put_page(). Otherwise > > there is an outside chance that the page would disappear from you unexpectedly > > depending on exactly how the driver was implemented. It would also > > behave slightly more like get_user_pages(). @@ -103,3 +103,9 @@ Thanks Mel Gorman Part-time Phd Student Linux Technology Center University of Limerick IBM Dublin Software Lab + +-- +To unsubscribe, send a message with 'unsubscribe linux-mm' in +the body to majordomo@kvack.org. For more info on Linux MM, +see: http://www.linux-mm.org/ . +Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a> diff --git a/a/content_digest b/N1/content_digest index 3ae5c79..a06137e 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -30,8 +30,8 @@ "\n" "Indeed.\n" "\n" - "> >> include/linux/hugetlb.h | \302\240 \302\2403 +++\n" - "> >> mm/hugetlb.c \302\240 \302\240 \302\240 \302\240 \302\240 \302\240| \302\240 23 +++++++++++++++++++++++\n" + "> >> include/linux/hugetlb.h | 3 +++\n" + "> >> mm/hugetlb.c | 23 +++++++++++++++++++++++\n" "> >> 2 files changed, 26 insertions(+)\n" "> >>\n" "> >> ---\n" @@ -53,7 +53,7 @@ "> >> + * before the page has been faulted.\n" "> >> + */\n" "> >> +struct page *hugetlb_get_user_page(struct vm_area_struct *vma,\n" - "> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 unsigned long address)\n" + "> >> + unsigned long address)\n" "> >> +{\n" "> >\n" "> > Your leader and comments say that the function can be used before the pages\n" @@ -82,22 +82,22 @@ "the page was already in the page cache for example. This would catch already\n" "faulted pages as a side-effect.\n" "\n" - "> >> + \302\240 \302\240 int ret;\n" - "> >> + \302\240 \302\240 int cnt = 1;\n" - "> >> + \302\240 \302\240 struct page *pg;\n" - "> >> + \302\240 \302\240 struct hstate *h = hstate_vma(vma);\n" + "> >> + int ret;\n" + "> >> + int cnt = 1;\n" + "> >> + struct page *pg;\n" + "> >> + struct hstate *h = hstate_vma(vma);\n" "> >> +\n" - "> >> + \302\240 \302\240 address = address & huge_page_mask(h);\n" - "> >> + \302\240 \302\240 ret = follow_hugetlb_page(vma->vm_mm, vma, &pg,\n" - "> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 NULL, &address, &cnt, 0, 0);\n" - "> >> + \302\240 \302\240 if (ret < 0)\n" - "> >> + \302\240 \302\240 \302\240 \302\240 \302\240 \302\240 return ERR_PTR(ret);\n" - "> >> + \302\240 \302\240 put_page(pg);\n" + "> >> + address = address & huge_page_mask(h);\n" + "> >> + ret = follow_hugetlb_page(vma->vm_mm, vma, &pg,\n" + "> >> + NULL, &address, &cnt, 0, 0);\n" + "> >> + if (ret < 0)\n" + "> >> + return ERR_PTR(ret);\n" + "> >> + put_page(pg);\n" "> >> +\n" - "> >> + \302\240 \302\240 return pg;\n" + "> >> + return pg;\n" "> >> +}\n" "> >\n" - "> > I think the caller should be responsible for calling put_page(). \302\240Otherwise\n" + "> > I think the caller should be responsible for calling put_page(). Otherwise\n" "> > there is an outside chance that the page would disappear from you unexpectedly\n" "> > depending on exactly how the driver was implemented. It would also\n" "> > behave slightly more like get_user_pages().\n" @@ -115,6 +115,12 @@ "-- \n" "Mel Gorman\n" "Part-time Phd Student Linux Technology Center\n" - University of Limerick IBM Dublin Software Lab + "University of Limerick IBM Dublin Software Lab\n" + "\n" + "--\n" + "To unsubscribe, send a message with 'unsubscribe linux-mm' in\n" + "the body to majordomo@kvack.org. For more info on Linux MM,\n" + "see: http://www.linux-mm.org/ .\n" + "Don't email: <a href=mailto:\"dont@kvack.org\"> email@kvack.org </a>" -08fb067199023564a06fb7015d8bb15754923db722d54b19d4d5868a01ac4f3b +cf9adb4bed9829ac63197ae16fcace616a5a703d72e3975c14420e48e121715c
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.