Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1490165
| From | Michal Hocko <mhocko@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges |
| Date | 2016-09-23 16:30 +0200 |
| Message-ID | <skzEe-4NF-3@gated-at.bofh.it> (permalink) |
| References | (4 earlier) <skxM6-3BX-15@gated-at.bofh.it> <sky5r-3Iu-13@gated-at.bofh.it> <skyoO-44f-23@gated-at.bofh.it> <skyRQ-4e3-17@gated-at.bofh.it> <skzuy-4Kq-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Fri 23-09-16 22:14:40, zijun_hu wrote: > On 2016/9/23 21:33, Michal Hocko wrote: > > On Fri 23-09-16 21:00:18, zijun_hu wrote: > >> On 09/23/2016 08:42 PM, Michal Hocko wrote: > >>>>>> no, it don't work for many special case > >>>>>> for example, provided PMD_SIZE=2M > >>>>>> mapping [0x1f8800, 0x208800) virtual range will be split to two ranges > >>>>>> [0x1f8800, 0x200000) and [0x200000,0x208800) and map them separately > >>>>>> the first range will cause dead loop > >>>>> > >>>>> I am not sure I see your point. How can we deadlock if _both_ addresses > >>>>> get aligned to the page boundary and how does PMD_SIZE make any > >>>>> difference. > >>>>> > >>>> i will take a example to illustrate my considerations > >>>> provided PUD_SIZE == 1G, PMD_SIZE == 2M, PAGE_SIZE == 4K > >>>> it is used by arm64 normally > >>>> > >>>> we want to map virtual range [0xffffffff_ffc08800, 0xffffffff_fffff800) by > >>>> ioremap_page_range(),ioremap_pmd_range() is called to map the range > >>>> finally, ioremap_pmd_range() will call > >>>> ioremap_pte_range(pmd, 0xffffffff_ffc08800, 0xffffffff_fffe0000) and > >>>> ioremap_pte_range(pmd, 0xffffffff_fffe0000, 0xffffffff fffff800) separately > >>> > >>> but those ranges are not aligned and it ioremap_page_range fix them up > >>> to _be_ aligned then there is no problem, right? So either I am missing > >>> something or we are talking past each other. > >>> > >> my complementary considerations are show below > >> > >> why not to round up the range start boundary to page aligned? > >> 1, it don't remain consistent with the original logic > >> take map [0x1800, 0x4800) as example > >> the original logic map range [0x1000, 0x2000), but rounding up start boundary > >> don't mapping the range [0x1000, 0x2000) > > > > just look at how we do that for the mmap... > > okay > i don't familiar with mmap code very well now mmap basically does addr &= PAGE_MASK (modulo mmap_min_addr) and len = PAGE_ALIGN(len). this is [star, end) raher than [start, start+len) but you should get the point I guess. -- Michal Hocko SUSE Labs
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-21 06:30 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Michal Hocko <mhocko@kernel.org> - 2016-09-22 14:50 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-22 17:20 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Michal Hocko <mhocko@kernel.org> - 2016-09-23 10:50 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 14:30 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Michal Hocko <mhocko@kernel.org> - 2016-09-23 14:50 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 15:10 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Michal Hocko <mhocko@kernel.org> - 2016-09-23 15:40 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 16:20 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Michal Hocko <mhocko@kernel.org> - 2016-09-23 16:30 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 17:00 +0200
Re: [PATCH v2 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 08:00 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Tejun Heo <tj@kernel.org> - 2016-09-23 16:50 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges zijun_hu <zijun_hu@zoho.com> - 2016-09-23 17:50 +0200
Re: [PATCH 1/1] lib/ioremap.c: avoid endless loop under ioremapping page unaligned ranges Tejun Heo <tj@kernel.org> - 2016-09-23 18:30 +0200
csiph-web