Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1185027 > unrolled thread
| Started by | Christoph Lameter <cl@linux.com> |
|---|---|
| First post | 2015-07-15 22:30 +0200 |
| Last post | 2015-07-15 23:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages Christoph Lameter <cl@linux.com> - 2015-07-15 22:30 +0200
Re: [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-07-15 23:20 +0200
| From | Christoph Lameter <cl@linux.com> |
|---|---|
| Date | 2015-07-15 22:30 +0200 |
| Subject | Re: [PATCH 00/16] Sanitize usage of ->flags and ->mapping for tail pages |
| Message-ID | <pMBtw-1JF-9@gated-at.bofh.it> |
On Thu, 19 Mar 2015, Kirill A. Shutemov wrote: > Currently we take naive approach to page flags on compound -- we set the > flag on the page without consideration if the flag makes sense for tail > page or for compound page in general. This patchset try to sort this out > by defining per-flag policy on what need to be done if page-flag helper > operate on compound page. Well we hand pointers to head pages around if handling compound pages. References to tail pages are dicey and should only be used in a limited way. At least that is true in the slab allocators and that was my understanding in earlier years. Therefore it does not make sense then check for tail pages. > For now I catched one case of illigal usage of page flags or ->mapping: > sound subsystem allocates pages with __GFP_COMP and maps them with PTEs. > It leads to setting dirty bit on tail pages and access to tail_page's > ->mapping. I don't see any bad behaviour caused by this, but worth fixing > anyway. Does this catch any errors? > This patchset makes more sense if you take my THP refcounting into > account: we will see more compound pages mapped with PTEs and we need to > define behaviour of flags on compound pages to avoid bugs. Ok that introduces the risk of pointers to tail pages becoming more of an issue. But that does not affect non pagecache pages. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | "Kirill A. Shutemov" <kirill@shutemov.name> |
|---|---|
| Date | 2015-07-15 23:20 +0200 |
| Message-ID | <pMCfU-2Uk-19@gated-at.bofh.it> |
| In reply to | #1185027 |
On Wed, Jul 15, 2015 at 03:20:01PM -0500, Christoph Lameter wrote: > On Thu, 19 Mar 2015, Kirill A. Shutemov wrote: > > > Currently we take naive approach to page flags on compound -- we set the > > flag on the page without consideration if the flag makes sense for tail > > page or for compound page in general. This patchset try to sort this out > > by defining per-flag policy on what need to be done if page-flag helper > > operate on compound page. > > Well we hand pointers to head pages around if handling compound pages. > References to tail pages are dicey and should only be used in a limited > way. At least that is true in the slab allocators and that was my > understanding in earlier years. Therefore it does not make sense > then check for tail pages. This is preparation patchset for THP refcounting rework. With new refcounting sub-pages for THP can be mapped with PTEs, therefore we will see tail pages returned from pte_page(). I've tried ad-hoc approach to page flags wrt tail pages on earlier (pre LFS/MM) revisions of THP refcounting patchset. And IIRC, *you* pointed that it would be nice to have more systematic approach. And here's my attempt. > > For now I catched one case of illigal usage of page flags or ->mapping: > > sound subsystem allocates pages with __GFP_COMP and maps them with PTEs. > > It leads to setting dirty bit on tail pages and access to tail_page's > > ->mapping. I don't see any bad behaviour caused by this, but worth fixing > > anyway. > > Does this catch any errors? It helped to catch BUG fixed by c761471b58e6 (mm: avoid tail page refcounting on non-THP compound pages) and helped with work on refcounting patchset. > > This patchset makes more sense if you take my THP refcounting into > > account: we will see more compound pages mapped with PTEs and we need to > > define behaviour of flags on compound pages to avoid bugs. > > Ok that introduces the risk of pointers to tail pages becoming more of an > issue. But that does not affect non pagecache pages. We don't have huge pages in pagecache yet. Refcounting patchset only affects anon-THP. And makes compound pages suitable for pagecache. We also have PTE-mapped compound pages -- in sound subsystem and some drivers (framebuffer, etc.) -- Kirill A. Shutemov -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web