Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752728AbdHJOqX (ORCPT ); Thu, 10 Aug 2017 10:46:23 -0400 Received: from mail-sn1nam02on0092.outbound.protection.outlook.com ([104.47.36.92]:44564 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752317AbdHJOqV (ORCPT ); Thu, 10 Aug 2017 10:46:21 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=zi.yan@cs.rutgers.edu; From: "Zi Yan" To: "Sam Ravnborg" , "David S . Miller" Cc: "Zi Yan" , sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: add pmd_t initializer __pmd() to work around a GCC bug. Date: Thu, 10 Aug 2017 10:46:08 -0400 Message-ID: <3DDB3EDA-D008-45C1-A5A9-A92DF74DFB5E@cs.rutgers.edu> In-Reply-To: <20170803131721.74011-1-zi.yan@sent.com> References: <20170803131721.74011-1-zi.yan@sent.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_231E0106-56D2-4C20-8AC3-CEB79C2FD081_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Mailer: MailMate (2.0BETAr6089) X-Originating-IP: [128.6.37.148] X-ClientProxiedBy: DM5PR15CA0034.namprd15.prod.outlook.com (10.174.245.148) To BN6PR14MB1651.namprd14.prod.outlook.com (10.171.176.17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7c18d4f3-890e-4825-077f-08d4dffe8f42 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR14MB1651; X-Microsoft-Exchange-Diagnostics: 1;BN6PR14MB1651;3:eQZ7tvWrHnk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hFPoOlO+6A6c4v+2n7qWxhEYGZgF/1DIjXJeeN/s84nii4mjhkKVUofuJGYVcrRwMk9Tqe/IlkD+aEM7MYIe8+qs2mBzzaZHBQ9okscs0MFF5bmBAH/nI+OnJCpmJEtn4zCcC/mhTV26Tdq+bkoxkfjN3YkEtoFimlgSj/ZSp92Y0W+XP7Iry7fni5hNvE5inCcGTcVfIPHLXugb3ermG7+h1oru49N6gywo0imPpJ7mfBqsg0FOB4lRkXKkrBgE0xOTytUdJAY3bAm9VisblQVtRAD7s2PI9NOvGClv3NMArS2wBrA2OhuMkzGCD6aJ2pQgW1+;4:GiS3xMOHYfRof6cYczK5RWWIqBQ2OMG48brds+ShZ5iNT/hvqlK9/NK4WmehfaRnQqd2S2+Jb6Ey5BYVwueQNjTTC8D7ZXrHGaN/YwS9h168/2P9Yhk1kaY3yRr7CP2f+B9CuDr9NlEBzR6Ev1Aqf7L9I5W4DYuPVDQ4sBWFyb102ShUKbodp8I/joNvK2uSunsQt9jeLiFnLZUL1CrCFOJr8EWfVDAWKaghTtYuEkGMagP0GoXhVp3vrtvbSAE5ThEaSBk6A2L07Iahv0bAQfvdDI0OBmqdrjd9cNNguqjd2cEGLOFyVCWkPN53RzfVBLP2ImmfhUgyUJ1TalWEvg== X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(84791874153150); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(93001095)(6041248)(20161123558100)(20161123560025)(20161123562025)(20161123564025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR14MB1651;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR14MB1651; X-Forefront-PRVS: 03950F25EC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(7370300001)(4630300001)(6049001)(6009001)(39860400002)(39400400002)(39450400003)(39840400002)(39850400002)(39410400002)(199003)(189002)(24454002)(5890100001)(86362001)(6306002)(2906002)(6246003)(88552002)(105586002)(3846002)(7736002)(6116002)(966005)(305945005)(106356001)(38730400002)(6486002)(81166006)(229853002)(81156014)(50226002)(68736007)(7350300001)(4326008)(53546010)(8676002)(77096006)(84326002)(83716003)(568964002)(66066001)(90366009)(2950100002)(82746002)(97736004)(42186005)(189998001)(42882006)(50986999)(53936002)(6666003)(478600001)(76176999)(25786009)(5660300001)(33656002)(75432002)(101416001)(72826003);DIR:OUT;SFP:1102;SCL:1;SRVR:BN6PR14MB1651;H:[172.27.32.61];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN6PR14MB1651;23:HtBaN2QmtFJ1zol+4sfFAzg4tEUSRGnrHJv1aMFet?= =?us-ascii?Q?/C9USZKVfaAI/kpLF3OB4xpffCZdZFlaX7p5VyJX/TVxvqaaKaY7U2ODjcGT?= =?us-ascii?Q?xkpnWX594eHbw0hWKEmxjKVUy68DVQlEx65/E1Z+JCAQ5whn9XIaWYQ4lyF2?= =?us-ascii?Q?UUv92g6XW+tv67hpbM6VuI+tsOeMAZPpo/hLsYZiGoRRehQo90BwXnNJnnqb?= =?us-ascii?Q?XHO6N/3cUcEkqbyHqQhdYeKLJQtMvq/6DfcKtEzyTD9yvx0phNOSZlLHFhES?= =?us-ascii?Q?et3oCoG6oBv6zLyj8ntixadZlDPZarqhnIfT5iC71CgKd9i6vfBuOyg0hl0I?= =?us-ascii?Q?9jWM1xzojpHCZaccZM4GY9oUqXaLdfQeXTc5vgjsCRzLr46V0w9d/iAzu519?= =?us-ascii?Q?eNWgv3pH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LzRTWH2mL6UqcB7GVOn7ykvi30DIBZMRW1tE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2017 14:46:12.4863 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR14MB1651 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3096 Lines: 100 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_231E0106-56D2-4C20-8AC3-CEB79C2FD081_= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Ping. Just wonder what is the status of this patch. This patch is trivial and I successfully compiled it for sparc32. swp_entry_to_pmd() will be the only user of __pmd() in sparc32, returning __pmd(0). Having __pmd() can help replace following code in include/linux/swapops.h (in linux-next: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/= include/linux/swapops.h#n224): static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) { pmd_t e; memset(&e, 0, sizeof(pmd_t)); return e; } with: static inline pmd_t swp_entry_to_pmd(swp_entry_t entry) { return __pmd(0); } It makes the code more portable. Thanks. -- Best Regards Yan Zi On 3 Aug 2017, at 9:17, Zi Yan wrote: > From: Zi Yan > > THP migration is added but only supports x86_64 at the moment. For all > other architectures, swp_entry_to_pmd() only returns a zero pmd_t. > > Due to a GCC zero initializer bug #53119, the standard (pmd_t){0} > initializer is not accepted by all GCC versions. __pmd() is a feasible > workaround. In addition, sparc32's pmd_t is an array instead of a singl= e > value, so we need (pmd_t){ {0}, } instead of (pmd_t){0}. Thus, > a different __pmd() definition is needed in sparc32. > > Signed-off-by: Zi Yan > --- > arch/sparc/include/asm/page_32.h | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/sparc/include/asm/page_32.h b/arch/sparc/include/asm/= page_32.h > index 0efd0583a8c9..6249214148c2 100644 > --- a/arch/sparc/include/asm/page_32.h > +++ b/arch/sparc/include/asm/page_32.h > @@ -68,6 +68,7 @@ typedef struct { unsigned long iopgprot; } iopgprot_t= ; > #define iopgprot_val(x) ((x).iopgprot) > > #define __pte(x) ((pte_t) { (x) } ) > +#define __pmd(x) ((pmd_t) { { (x) }, }) > #define __iopte(x) ((iopte_t) { (x) } ) > #define __pgd(x) ((pgd_t) { (x) } ) > #define __ctxd(x) ((ctxd_t) { (x) } ) > @@ -95,6 +96,7 @@ typedef unsigned long iopgprot_t; > #define iopgprot_val(x) (x) > > #define __pte(x) (x) > +#define __pmd(x) ((pmd_t) { { (x) }, }) > #define __iopte(x) (x) > #define __pgd(x) (x) > #define __ctxd(x) (x) > -- = > 2.13.2 --=_MailMate_231E0106-56D2-4C20-8AC3-CEB79C2FD081_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJZjHGxAAoJEEGLLxGcTqbMEK0IAIeZtAfDX9+lFu6SjAtW6Ito Mut52feYlCdRYZcPEx579uCDQnofMtvH9Nc1UJs5vkeDMcetS7Qkmxf++IsiHnvW jMe7Gp++SURBbKmHvNUUeMo9U4wUsmIRMJGcNfyM/tBjdTi+i18w4Cls5N6gMD43 hTR8ip8UgLqGySwifliDt5xgxsxfjI5LQJRHuvUmOMpURlnBPAVJDferCUDBXlZE RKNtV992F5JPppuklA7lSjfFU2/Qx4QXrGgggE0bRDm12IPb+vCYm6XFR7rog4hP crD8contmnnwQmxv+vkdrIH5fbNdbuWyf2zRdfS3Sr0agARgF1EcumLCTnEKG2c= =26bw -----END PGP SIGNATURE----- --=_MailMate_231E0106-56D2-4C20-8AC3-CEB79C2FD081_=--