Message ID | 1453233538-24029-1-git-send-email-cmetcalf@ezchip.com |
---|---|
State | Dropped |
Headers |
Received: (qmail 86873 invoked by alias); 19 Jan 2016 19:59:10 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 86839 invoked by uid 89); 19 Jan 2016 19:59:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=BAYES_40, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 spammy=Bump, 1897, HAuthentication-Results:fail, HX-Exchange-Antispam-Report-CFA-Test:13024025 X-HELO: emea01-db3-obe.outbound.protection.outlook.com Authentication-Results: spf=fail (sender IP is 12.216.194.146) smtp.mailfrom=ezchip.com; ezchip.com; dkim=none (message not signed) header.d=none; ezchip.com; dmarc=none action=none header.from=ezchip.com; Received-SPF: Fail (protection.outlook.com: domain of ezchip.com does not designate 12.216.194.146 as permitted sender) receiver=protection.outlook.com; client-ip=12.216.194.146; helo=ld-1.internal.tilera.com; From: Chris Metcalf <cmetcalf@ezchip.com> To: <libc-alpha@sourceware.org>, Florian Weimer <fweimer@redhat.com> CC: Chris Metcalf <cmetcalf@ezchip.com> Subject: [PATCH] tst-malloc-thread-exit: run less aggressively Date: Tue, 19 Jan 2016 14:58:58 -0500 Message-ID: <1453233538-24029-1-git-send-email-cmetcalf@ezchip.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD045; 1:Cfq/5Bg8WWfdqRryLY7iikxDiR3Gjusgdc1Y7dfIzmdfF5zzExhjsUIThdvG7uq6dHuRCEqiZhv5zFTsHz74Bl8PpqEKvhS/UK5Kn5lIdPuh46i68jwTJF2Fc0szOY3Pi8WTxnDrKp0+9jMbM7BjOly9+6QmT2y1+x2kuOeWHEwRC+RQEdZAZIYIQl60YZlg+3DcDy5orGEiZnu78Zv0ILqmduoaADeApIY5vRZTnsrNGPyrckIOP8Z9zwxZeJwIx/VReqp1J0Y10dk1Y/u5TuifaWxqbRkeIB7BwIr6nMnO7nyhCLii4vAGzda2Umcr8LCTcdrgLdFlUyDrCKLY8HOPTkvAio9vgIrALr6IvwrkaApqpeqV3zqTmGzJrQPEi9GK2RLjL5ZzLgdV7Biid487YAK9ruMWshj4lXySFhKasb98TK+VBy9P5d+hpy/8 X-Forefront-Antispam-Report: CIP:12.216.194.146; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(377424004)(189002)(54534003)(4326007)(104016004)(50986999)(47776003)(86362001)(19580395003)(42186005)(92566002)(2906002)(19580405001)(230783001)(36756003)(50226001)(5003940100001)(105606002)(107886002)(4001430100002)(5008740100001)(229853001)(6806005)(50466002)(48376002)(1096002)(1220700001)(189998001)(586003)(5001970100001)(106466001)(5001770100001)(11100500001)(87936001)(85426001)(33646002); DIR:OUT; SFP:1101; SCL:1; SRVR:AMSPR02MB119; H:ld-1.internal.tilera.com; FPR:; SPF:Fail; PTR:wb-fw1.tilera.com; A:1; MX:1; LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1; AMSPR02MB119; 2:p8iZXotOxsotixXbuPS+AS7sG7wQrkbagLTR/JH2NhKIetI7WBcmH9W8Embyc8rt26/GOd/FZ/w2iYqI4IvmzAlImdndt8PPrW4Ic+vXZ1xhRjdzPdV4sRtcoKeEXHvtJR9k3p6x2bXsoMtJ9QlKMA==; 3:8XR7xuNOZ9tLllILFmN4XVO7T5zkH1X46PnluOKTPRn0mlhvyng/njS9wru0DgwdhbmqEHWlgoEJeMDILbBoFN019VTs81iV7lIzP6HehJhQfh53bVELObMkSl28BZoDeywvp/qHbZ7ULPGb+WVbeOZJyG+J6aIetEOJQWUNl2UzY8xVh+dwDd4PBZ3dzoQImabIlAj3tAYTQKFTUtkexkGo/B4AYPB9HRiL7WGuhq0=; 25:mxrf4el6KluTCUO0q7e57MjsKCMmSWnwZSgA8huujIi8Ba4cCLzkjQGl38ZUOXEJPTwuxTCruY69OZmV+JnzNdEM+rGeg2WKsmLxgNUGLRTFZJH2KX0s7heZi4jUi6GtpvtakjKqY9tHaokv033Eu1hCBC1+F+h5uFcX6dP52/bXutJVtfKqH7ApOySbYpetokfaHh5tTCOPSMxGRBZItM8/bqvRRvIzp4QmhAuHxaZa/tVybViLV7EXVfQZUFrw; 20:h0S5Rtp4mvS+7jwH0AoqX7pkUSj98Mv5lUSEaNGkYSKsOlHfzZOcYIHydDb3G5uOWJOsAAfmWsfNIcUOS9l7j/mJNGOhXES/iaWsIqWnT8djv+Q5mNfAaa32I6G9yey0JJxizk4C7Lubc8Yh9eC8RjMDKqs5aXJmYz6hbHTTatk= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:AMSPR02MB119; X-MS-Office365-Filtering-Correlation-Id: a588a769-f083-41ea-4187-08d3210afa19 X-Microsoft-Antispam-PRVS: <AMSPR02MB119F03A8A4EE2F2A92144F0AFC10@AMSPR02MB119.eurprd02.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(121898900299872); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(13017025)(13018025)(13023025)(520078)(13015025)(8121501046)(13024025)(10201501046)(3002001); SRVR:AMSPR02MB119; BCL:0; PCL:0; RULEID:; SRVR:AMSPR02MB119; X-Microsoft-Exchange-Diagnostics: 1; AMSPR02MB119; 4:pv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NIHpN0TO?= =?us-ascii?Q?HIvnzUzBveTtKMlvPPdLBt54ec7VGoeebkGFj4ORwCNDjqWG26++w0O9V9wz?= =?us-ascii?Q?AmXaogLczhHgcuw8DFXPdSNdw55VD529EzRLUzltsJFnybcg1nQvCBHhpnGe?= =?us-ascii?Q?S6JyPmi5PFsP6We8lqbG4TQGEZyceHczUDIyVXrfMLrgi2Q91PlY04crA6cb?= =?us-ascii?Q?eQW/g7DNw8tK3Kb7EckNB/lFtDADtBi3pD0OEMILJ9HHB7FQGdEc4j1EDWaA?= =?us-ascii?Q?4t/DtqO0kwji7klFcreSbO/QOtVo5vbc0L7xHwU2koUzlDGBokbVwoEnJ+HU?= =?us-ascii?Q?uJZqV97VTY7/hqtrZPbhMAd3t0XdCG0dJbSLOzhrGzpyt/vKm36imzSbPGIf?= =?us-ascii?Q?g+mhqApsQXsBvF5Dh1DzxPprvLLcCV5ucVnUZ/27NLATcP2FgnPNUtL9oXgT?= =?us-ascii?Q?VaJ6YMryySWruA1m4Uw3FBJwPJE0zmIZO81ak28sBUNl3vjWG72dPY86nmVy?= =?us-ascii?Q?apyj3s4FDoTVvGdkvnZXncsEaoUSbjgqpAvC4fzk7a0alF7rxi3LbJxcddhs?= =?us-ascii?Q?PeE0kVvvwKw0aGomXLL88KYmfvhgfXsH6F4KVqxBxmXRj6dkKHGpmhbVS5wV?= =?us-ascii?Q?btU09hGb7Ndxa5Fu/5SbTKl0CrbuwRIIo8rjtyuM2NYTRI0nWIviS/2Xpf0P?= =?us-ascii?Q?hsYBH4advKtlN441bOimSWSjdefLwb5r2GbVKJJHAQMI8OTIPJGtzf3lLNFl?= =?us-ascii?Q?ttFMMhNTs=3D?= X-Microsoft-Exchange-Diagnostics: 1; AMSPR02MB119; 5:BlaO10rDNOYKyVhnShVg4T5tjQw1F1KNcZDN5d0Y39TmfHiA1LAAzXfl8pJXymlgh/DHGZ4d4YrRiEWeF+w//Bw9yRV/Ermn6rX16rnniBkkS4Oe5dmAOhKVlBbSLPU7ypoOTN1Ssrxgnk982ek6mQ==; 24:Sd0LKxkbRlJT1OzwxxDs5SUSs1OfbJPB+diok9P69+dqH6gs0gP2/6UmMEo5j4J/q/fF4a83TqA2woVo6j2vNGudIgbTJT9S1pPy9eCcyTs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2016 19:59:01.4508 (UTC) X-MS-Exchange-CrossTenant-Id: 0fc16e0a-3cd3-4092-8b2f-0a42cff122c3 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=0fc16e0a-3cd3-4092-8b2f-0a42cff122c3; Ip=[12.216.194.146]; Helo=[ld-1.internal.tilera.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AMSPR02MB119 |
Commit Message
Chris Metcalf
Jan. 19, 2016, 7:58 p.m. UTC
On a 64-bit machine, the previous code would run up to 5 x 8 x NPROCS threads, or 2,880 threads on a 72-core TILE-Gx. But since typically userspace runs with an RLIMIT_NPROC value of 1024, the test will fail on such a machine. Instead, bound the outer thread count to 200, rather than 8 x NPROCS, so that the total number of threads created is max 1000. This may still be a little risky when running in a "make -j check" context but should at least pass when run separately to confirm a FAIL. Also, bump up the timeout from 7 to 20, since it takes about 17 seconds on a 72-core TILE-Gx machine. Start trying to exit threads at a hard 5-second point rather than waiting until two seconds before the timeout, since the extra time seems to be mainly in quiescing and joining all the outstanding threads. --- Can I push this for 2.23? It fixes a test failure for tilegx. ChangeLog | 5 +++++ malloc/tst-malloc-thread-exit.c | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) 2016-01-19 Chris Metcalf <cmetcalf@ezchip.com> * malloc/tst-malloc-thread-exit.c (TIMEOUT): Bump up to 20. Also clamp thread count to under 1024.
Comments
On 01/19/2016 08:58 PM, Chris Metcalf wrote: > On a 64-bit machine, the previous code would run up to > 5 x 8 x NPROCS threads, or 2,880 threads on a 72-core TILE-Gx. > But since typically userspace runs with an RLIMIT_NPROC value > of 1024, the test will fail on such a machine. Instead, bound > the outer thread count to 200, rather than 8 x NPROCS, so that > the total number of threads created is max 1000. This may still > be a little risky when running in a "make -j check" context but > should at least pass when run separately to confirm a FAIL. I posted a patch due to similar issues: <https://sourceware.org/ml/libc-alpha/2015-12/msg00537.html> This change will bring down the run time considerably. > Can I push this for 2.23? It fixes a test failure for tilegx. Not just there. I wasn't aware of the thread count limit. I can post a patch tomorrow which uses mallopt to reduce the arena count, then we should be able to run this test with just 8 threads (but I will have to verify it still triggers the original failure). Florian
diff --git a/malloc/tst-malloc-thread-exit.c b/malloc/tst-malloc-thread-exit.c index f4aa21af8668..16464e5dfcde 100644 --- a/malloc/tst-malloc-thread-exit.c +++ b/malloc/tst-malloc-thread-exit.c @@ -32,7 +32,7 @@ #include <stdlib.h> #include <unistd.h> -#define TIMEOUT 7 +#define TIMEOUT 20 static bool termination_requested; static int inner_thread_count = 4; @@ -168,8 +168,10 @@ do_test (void) outer_thread_count *= 8; } - /* Leave some room for shutting down all threads gracefully. */ - int timeout = TIMEOUT - 2; + /* Respect typical non-root RLIMIT_NPROC of 1,024 processes. */ + long max_outer_thread_count = 200; + if (outer_thread_count > max_outer_thread_count) + outer_thread_count = max_outer_thread_count; pthread_t *threads = calloc (sizeof (*threads), outer_thread_count); if (threads == NULL) @@ -189,7 +191,7 @@ do_test (void) } } - struct timespec ts = {timeout, 0}; + struct timespec ts = {5, 0}; if (nanosleep (&ts, NULL)) { printf ("error: error: nanosleep: %m\n");