Received: by 10.223.185.116 with SMTP id b49csp5674318wrg; Wed, 7 Mar 2018 16:20:18 -0800 (PST) X-Google-Smtp-Source: AG47ELtNhUCwFr52y2nCpi6YvAD5lFJBiwm6/WcjLl7UKm2YY+M3pHLuZJpAuRLt+yaXs1oLpOPj X-Received: by 2002:a17:902:8287:: with SMTP id y7-v6mr4214894pln.436.1520468418890; Wed, 07 Mar 2018 16:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520468418; cv=none; d=google.com; s=arc-20160816; b=s8y5mHzanGhTOJ5UmFZlxMVBL5G4wRslQEXF2FJ/3tQOqaxlbnQB8prc/vXvv5ksHF lHSGht3aESDNRom3w4I1pHagKU8hZUIcn59NS9RpjjDZpLW0nrCBnTiWpXzA6Iufm0+7 kqDXALZfU2QuJ0/uShYsLK8D+MhbsE16rZJAIpth0PoyGb9mOdfHB8LHZCec1RSs1T6E HWgDnJe7MrdW5JTE2Fict8F9bunENKvrSEnwcxHjE7gmAtsYqXyFtzo1wxdQQ66FDN67 G2Jj8R+FiEDqJWfwfbYuL3kLQINIgBzKSYjrh8I8sU+4jOz+oBYkeg2Z3IxD3jgFI/wD GL2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :arc-authentication-results; bh=df0H/INrbnwx0wVc4Oi8IdBPcGKIBLlaTQHC+/Fe+fU=; b=sfLtw7hNieDuvP5YjnsY6hnE46x+3Xr7QwhwmlrbU7WRz0Go+jkbenvS6vPOovWSEL nv+wR0U3k3VXcjDIN8/kjyWcg6x0GRbo9bwCa8C5/Im7wTl9QDY/sZI9/whywd8m26Aw nNFf29kaTbH25fBkFtSK7j1JhEeQxmTo+D9DlFhHAe72YgpafsfZcaxm/VU3h7Xg/vZW m+OGZ/PHzi+8u15M2JmtDX8ScF1pm+1RbQR0tFsu1XWNvDc4oKB+ui9bI2+2Of/A7iO8 FQBRXuiqta8DNVOZsbW/csD/q+OAI17bjh2LXchkuBVL0J5C62xkQGWFAsb+oprHU9Tz 4uhw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t193si12136323pgb.156.2018.03.07.16.20.02; Wed, 07 Mar 2018 16:20:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934158AbeCHATH convert rfc822-to-8bit (ORCPT + 99 others); Wed, 7 Mar 2018 19:19:07 -0500 Received: from mga06.intel.com ([134.134.136.31]:51126 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932448AbeCHATF (ORCPT ); Wed, 7 Mar 2018 19:19:05 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 16:19:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,437,1515484800"; d="scan'208";a="209703997" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by fmsmga005.fm.intel.com with ESMTP; 07 Mar 2018 16:19:04 -0800 Received: from FMSMSX109.amr.corp.intel.com ([169.254.15.144]) by fmsmsx107.amr.corp.intel.com ([169.254.6.41]) with mapi id 14.03.0319.002; Wed, 7 Mar 2018 16:19:04 -0800 From: "Dilger, Andreas" To: NeilBrown CC: "Drokin, Oleg" , Greg Kroah-Hartman , James Simmons , "Linux Kernel Mailing List" , Lustre Development List Subject: Re: [PATCH 06/17] staging: lustre: get entropy from nid when nid set. Thread-Topic: [PATCH 06/17] staging: lustre: get entropy from nid when nid set. Thread-Index: AQHTsbWhejTdDYmLxEG1+FANzuvZH6PGCNGA Date: Thu, 8 Mar 2018 00:19:04 +0000 Message-ID: References: <151994679573.7628.1024109499321778846.stgit@noble> <151994708524.7628.17942703834112140684.stgit@noble> In-Reply-To: <151994708524.7628.17942703834112140684.stgit@noble> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.254.6.233] Content-Type: text/plain; charset="us-ascii" Content-ID: <3C04174F11357F4B9571E604AB98B183@intel.com> Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mar 1, 2018, at 16:31, NeilBrown wrote: > > When the 'lustre' module is loaded, it gets a list of > net devices and uses the node ids to add entropy > to the prng. This means that the network interfaces need > to be configured before the module is loaded, which prevents > the module from being compiled into a monolithic kernel. > > So move this entropy addition to the moment when > the interface is imported to LNet and the node id is first known. It took me a while to convince myself this is correct, but this is moving the entropy addition earlier in the startup sequence, and that is a good thing. The important factor is to ensure that the client UUID (generated at mount time) is unique across all clients, and adding the node address to the entropy ensures this, even if many thousands of identical diskless nodes boot and mount simultaneously. Reviewed-by: Andreas Dilger > Signed-off-by: NeilBrown > --- > drivers/staging/lustre/lnet/lnet/api-ni.c | 7 +++++++ > drivers/staging/lustre/lustre/llite/super25.c | 17 +---------------- > 2 files changed, 8 insertions(+), 16 deletions(-) > > diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c > index 48d25ccadbb3..90266be0132d 100644 > --- a/drivers/staging/lustre/lnet/lnet/api-ni.c > +++ b/drivers/staging/lustre/lnet/lnet/api-ni.c > @@ -1214,6 +1214,7 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) > struct lnet_lnd *lnd; > struct lnet_tx_queue *tq; > int i; > + u32 seed; > > lnd_type = LNET_NETTYP(LNET_NIDNET(ni->ni_nid)); > > @@ -1352,6 +1353,12 @@ lnet_startup_lndni(struct lnet_ni *ni, struct lnet_ioctl_config_data *conf) > tq->tq_credits = lnet_ni_tq_credits(ni); > } > > + /* Nodes with small feet have little entropy. The NID for this > + * node gives the most entropy in the low bits. > + */ > + seed = LNET_NIDADDR(ni->ni_nid); > + add_device_randomness(&seed, sizeof(seed)); > + > CDEBUG(D_LNI, "Added LNI %s [%d/%d/%d/%d]\n", > libcfs_nid2str(ni->ni_nid), ni->ni_peertxcredits, > lnet_ni_tq_credits(ni) * LNET_CPT_NUMBER, > diff --git a/drivers/staging/lustre/lustre/llite/super25.c b/drivers/staging/lustre/lustre/llite/super25.c > index 9b0bb3541a84..861e7a60f408 100644 > --- a/drivers/staging/lustre/lustre/llite/super25.c > +++ b/drivers/staging/lustre/lustre/llite/super25.c > @@ -85,8 +85,7 @@ MODULE_ALIAS_FS("lustre"); > > static int __init lustre_init(void) > { > - struct lnet_process_id lnet_id; > - int i, rc; > + int rc; > > BUILD_BUG_ON(sizeof(LUSTRE_VOLATILE_HDR) != > LUSTRE_VOLATILE_HDR_LEN + 1); > @@ -125,20 +124,6 @@ static int __init lustre_init(void) > goto out_debugfs; > } > > - /* Nodes with small feet have little entropy. The NID for this > - * node gives the most entropy in the low bits > - */ > - for (i = 0;; i++) { > - u32 seed; > - > - if (LNetGetId(i, &lnet_id) == -ENOENT) > - break; > - if (LNET_NETTYP(LNET_NIDNET(lnet_id.nid)) != LOLND) { > - seed = LNET_NIDADDR(lnet_id.nid); > - add_device_randomness(&seed, sizeof(seed)); > - } > - } > - > rc = vvp_global_init(); > if (rc != 0) > goto out_sysfs; > > Cheers, Andreas -- Andreas Dilger Lustre Principal Architect Intel Corporation