From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756330AbcG1SMW (ORCPT ); Thu, 28 Jul 2016 14:12:22 -0400 Received: from smtprelay0248.hostedemail.com ([216.40.44.248]:55083 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752508AbcG1SMO (ORCPT ); Thu, 28 Jul 2016 14:12:14 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::,RULES_HIT:41:355:379:541:599:960:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1541:1593:1594:1711:1730:1747:1777:1792:2194:2199:2393:2553:2559:2562:2828:2899:2919:3138:3139:3140:3141:3142:3352:3622:3865:3867:3868:3871:3872:3873:4321:5007:6117:10004:10400:10848:11026:11232:11658:11783:11914:12043:12296:12438:12517:12519:12740:13069:13161:13229:13255:13311:13357:13439:13894:14659:14721:21080:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: north61_4d3c60ecdf600 X-Filterd-Recvd-Size: 1981 Message-ID: <1469729529.3998.59.camel@perches.com> Subject: Re: [BUG -next] "random: make /dev/urandom scalable for silly userspace programs" causes crash From: Joe Perches To: "Theodore Ts'o" , Heiko Carstens Cc: linux-next@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Martin Schwidefsky Date: Thu, 28 Jul 2016 11:12:09 -0700 In-Reply-To: <20160728034601.GC20032@thunk.org> References: <20160727071400.GA3912@osiris> <20160728034601.GC20032@thunk.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-07-27 at 23:46 -0400, Theodore Ts'o wrote: > On Wed, Jul 27, 2016 at 09:14:00AM +0200, Heiko Carstens wrote: > > > > it looks like your patch "random: make /dev/urandom scalable for silly > > userspace programs" within linux-next seems to be a bit broken: > > > > It causes this allocation failure and subsequent crash on s390 with fake > > NUMA enabled > Thanks for reporting this.  This patch fixes things for you, yes? trivia: > diff --git a/drivers/char/random.c b/drivers/char/random.c [] > @@ -1668,13 +1668,12 @@ static int rand_initialize(void) >  #ifdef CONFIG_NUMA >   pool = kmalloc(num_nodes * sizeof(void *), >          GFP_KERNEL|__GFP_NOFAIL|__GFP_ZERO); The __GFP_ZERO is unusual and this could use kcalloc instead. > - for (i=0; i < num_nodes; i++) { > + for_each_online_node(i) { >   crng = kmalloc_node(sizeof(struct crng_state), >       GFP_KERNEL | __GFP_NOFAIL, i); >   spin_lock_init(&crng->lock); >   crng_initialize(crng); >   pool[i] = crng; > - >   } >   mb(); >   crng_node_pool = pool;