diff for duplicates of <87txor828a.fsf@linux.vnet.ibm.com> diff --git a/a/1.txt b/N1/1.txt index 54db040..92a18d2 100644 --- a/a/1.txt +++ b/N1/1.txt @@ -4,26 +4,26 @@ > >> On Tue, Feb 26, 2013 at 01:34:59PM +0530, Aneesh Kumar K.V wrote: >>> From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com> ->>>=20 +>>> >>> +static inline int hpte_actual_psize(struct hash_pte *hptep, int psize) >>> +{ >>> + unsigned int mask; >>> + int i, penc, shift; >>> + /* Look at the 8 bit LP value */ ->>> + unsigned int lp =3D (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1); +>>> + unsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1); >>> + ->>> + penc =3D 0; ->>> + for (i =3D 0; i < MMU_PAGE_COUNT; i++) { +>>> + penc = 0; +>>> + for (i = 0; i < MMU_PAGE_COUNT; i++) { >>> + /* valid entries have a shift value */ >>> + if (!mmu_psize_defs[i].shift) >>> + continue; >>> + >>> + /* encoding bits per actual page size */ ->>> + shift =3D mmu_psize_defs[i].shift - 11; +>>> + shift = mmu_psize_defs[i].shift - 11; >>> + if (shift > 9) ->>> + shift =3D 9; ->>> + mask =3D (1 << shift) - 1; ->>> + if ((lp & mask) =3D=3D mmu_psize_defs[psize].penc[i]) +>>> + shift = 9; +>>> + mask = (1 << shift) - 1; +>>> + if ((lp & mask) == mmu_psize_defs[psize].penc[i]) >>> + return i; >>> + } >>> + return -1; @@ -34,7 +34,7 @@ >> the mask for the comparison needs to depend on the actual page size >> not the base page size. > -> How about the below. I am yet to test this in user space.=20 +> How about the below. I am yet to test this in user space. I needed to special case 4K case. This seems to work fine with the test. @@ -43,33 +43,39 @@ static inline int hpte_actual_psize(struct hash_pte *hptep, int psize) unsigned int mask; int i, penc, shift; /* Look at the 8 bit LP value */ - unsigned int lp =3D (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1); + unsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1); /* First check if it is large page */ if (!(hptep->v & HPTE_V_LARGE)) return MMU_PAGE_4K; - penc =3D 0; - for (i =3D 1; i < MMU_PAGE_COUNT; i++) { + penc = 0; + for (i = 1; i < MMU_PAGE_COUNT; i++) { /* valid entries have a shift value */ if (!mmu_psize_defs[i].shift) continue; /* * encoding bits per actual page size * PTE LP actual page size - * rrrr rrrz =E2=89=A58KB - * rrrr rrzz =E2=89=A516KB - * rrrr rzzz =E2=89=A532KB - * rrrr zzzz =E2=89=A564KB + * rrrr rrrz ≥8KB + * rrrr rrzz ≥16KB + * rrrr rzzz ≥32KB + * rrrr zzzz ≥64KB * ....... */ - shift =3D mmu_psize_defs[i].shift - + shift = mmu_psize_defs[i].shift - mmu_psize_defs[MMU_PAGE_4K].shift; if (shift > LP_BITS) - shift =3D LP_BITS; - mask =3D (1 << shift) - 1; - if ((lp & mask) =3D=3D mmu_psize_defs[psize].penc[i]) + shift = LP_BITS; + mask = (1 << shift) - 1; + if ((lp & mask) == mmu_psize_defs[psize].penc[i]) return i; } return -1; } + +-- +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 6330ef1..0bac56a 100644 --- a/a/content_digest +++ b/N1/content_digest @@ -6,7 +6,8 @@ "Subject\0Re: [PATCH -V1 09/24] powerpc: Decode the pte-lp-encoding bits correctly.\0" "Date\0Mon, 04 Mar 2013 23:41:01 +0530\0" "To\0Paul Mackerras <paulus@samba.org>\0" - "Cc\0linuxppc-dev@lists.ozlabs.org" + "Cc\0benh@kernel.crashing.org" + linuxppc-dev@lists.ozlabs.org " linux-mm@kvack.org\0" "\00:1\0" "b\0" @@ -16,26 +17,26 @@ ">\n" ">> On Tue, Feb 26, 2013 at 01:34:59PM +0530, Aneesh Kumar K.V wrote:\n" ">>> From: \"Aneesh Kumar K.V\" <aneesh.kumar@linux.vnet.ibm.com>\n" - ">>>=20\n" + ">>> \n" ">>> +static inline int hpte_actual_psize(struct hash_pte *hptep, int psize)\n" ">>> +{\n" ">>> +\tunsigned int mask;\n" ">>> +\tint i, penc, shift;\n" ">>> +\t/* Look at the 8 bit LP value */\n" - ">>> +\tunsigned int lp =3D (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1);\n" + ">>> +\tunsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1);\n" ">>> +\n" - ">>> +\tpenc =3D 0;\n" - ">>> +\tfor (i =3D 0; i < MMU_PAGE_COUNT; i++) {\n" + ">>> +\tpenc = 0;\n" + ">>> +\tfor (i = 0; i < MMU_PAGE_COUNT; i++) {\n" ">>> +\t\t/* valid entries have a shift value */\n" ">>> +\t\tif (!mmu_psize_defs[i].shift)\n" ">>> +\t\t\tcontinue;\n" ">>> +\n" ">>> +\t\t/* encoding bits per actual page size */\n" - ">>> +\t\tshift =3D mmu_psize_defs[i].shift - 11;\n" + ">>> +\t\tshift = mmu_psize_defs[i].shift - 11;\n" ">>> +\t\tif (shift > 9)\n" - ">>> +\t\t\tshift =3D 9;\n" - ">>> +\t\tmask =3D (1 << shift) - 1;\n" - ">>> +\t\tif ((lp & mask) =3D=3D mmu_psize_defs[psize].penc[i])\n" + ">>> +\t\t\tshift = 9;\n" + ">>> +\t\tmask = (1 << shift) - 1;\n" + ">>> +\t\tif ((lp & mask) == mmu_psize_defs[psize].penc[i])\n" ">>> +\t\t\treturn i;\n" ">>> +\t}\n" ">>> +\treturn -1;\n" @@ -46,7 +47,7 @@ ">> the mask for the comparison needs to depend on the actual page size\n" ">> not the base page size.\n" ">\n" - "> How about the below. I am yet to test this in user space.=20\n" + "> How about the below. I am yet to test this in user space. \n" "\n" "I needed to special case 4K case. This seems to work fine with the test.\n" "\n" @@ -55,35 +56,41 @@ "\tunsigned int mask;\n" "\tint i, penc, shift;\n" "\t/* Look at the 8 bit LP value */\n" - "\tunsigned int lp =3D (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1);\n" + "\tunsigned int lp = (hptep->r >> LP_SHIFT) & ((1 << LP_BITS) - 1);\n" "\n" "\t/* First check if it is large page */\n" "\tif (!(hptep->v & HPTE_V_LARGE))\n" "\t\treturn MMU_PAGE_4K;\n" "\n" - "\tpenc =3D 0;\n" - "\tfor (i =3D 1; i < MMU_PAGE_COUNT; i++) {\n" + "\tpenc = 0;\n" + "\tfor (i = 1; i < MMU_PAGE_COUNT; i++) {\n" "\t\t/* valid entries have a shift value */\n" "\t\tif (!mmu_psize_defs[i].shift)\n" "\t\t\tcontinue;\n" "\t\t/*\n" "\t\t * encoding bits per actual page size\n" "\t\t * PTE LP actual page size\n" - "\t\t * rrrr rrrz\t\t=E2=89=A58KB\n" - "\t\t * rrrr rrzz\t\t=E2=89=A516KB\n" - "\t\t * rrrr rzzz\t\t=E2=89=A532KB\n" - "\t\t * rrrr zzzz\t\t=E2=89=A564KB\n" + "\t\t * rrrr rrrz\t\t\342\211\2458KB\n" + "\t\t * rrrr rrzz\t\t\342\211\24516KB\n" + "\t\t * rrrr rzzz\t\t\342\211\24532KB\n" + "\t\t * rrrr zzzz\t\t\342\211\24564KB\n" "\t\t * .......\n" "\t\t */\n" - "\t\tshift =3D mmu_psize_defs[i].shift -\n" + "\t\tshift = mmu_psize_defs[i].shift -\n" "\t\t\t\tmmu_psize_defs[MMU_PAGE_4K].shift;\n" "\t\tif (shift > LP_BITS)\n" - "\t\t\tshift =3D LP_BITS;\n" - "\t\tmask =3D (1 << shift) - 1;\n" - "\t\tif ((lp & mask) =3D=3D mmu_psize_defs[psize].penc[i])\n" + "\t\t\tshift = LP_BITS;\n" + "\t\tmask = (1 << shift) - 1;\n" + "\t\tif ((lp & mask) == mmu_psize_defs[psize].penc[i])\n" "\t\t\treturn i;\n" "\t}\n" "\treturn -1;\n" - } + "}\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>" -111390774917358d862447f5278c85558bd6a052645dfe1e1cfe14475b15f8d1 +41129cc1c824785a4bff976a04bb56ccfc4508c85957f8524733b2f7a677bdd5
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.