Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp9156682ybl; Fri, 17 Jan 2020 07:14:48 -0800 (PST) X-Google-Smtp-Source: APXvYqyQiMo/ML5a9XWLhNn77aMG81cPldmR47RqDTOHqKTqigMtTQQoUjKg4gNiwTvjpKzC0nBA X-Received: by 2002:a05:6830:20d3:: with SMTP id z19mr6076346otq.330.1579274087882; Fri, 17 Jan 2020 07:14:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579274087; cv=none; d=google.com; s=arc-20160816; b=kVvTiJjXtBJFkeFzetHo+Xcot00zoIMnc/eFFTJUpYFD2zsAk73fxxsQcFWkXc9nKR ZRcd1MKRx1IxJoULZupmcZtKpCje2tfbXw9s1I2U/5BdZiLEDLoJ+74wBxI+E5SIDoDL +ZS9d/WZyFl1ZPpkFUokSJZWsOat+x0F3Cn3qKPK4GpJG37dLuKrINLaJfH5cZNuNFPN dJ/N05RnlAfDOIqSUxLnMz+f/3oUD6r7yMss7lN6GByEgXaCLJzzx+j0E0y08qaKWeHx UzZ+N8ToITbvDtXpNh8ZZqRaj7NXbB/CRqHIyRxVP3jjl3/ZhLILrrR3yqjI9ZtdKDCq 18Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:ironport-sdr:dkim-signature; bh=liU8VVh1AmwQVqnJH1m8iN1kalvA++0k8Qduc3jxkQ4=; b=LJD6bLXsUf50GPe0LfTQyOh53X+onSc0bHggvqK5oZ3z3qGjVYs/KJi5/21uvocpV6 p4MiukszrRI4cxbJZkqTyZbU0I5PU2qc2Doj3EJQ1MNSFeLBQa8LkMe7sEW5hptFVOlZ dX9oR5MCSyh2Ob14spqpZHUEr9yeuJYq9VW+mwnRrJ62R12f3lnmwQTavbPRlMUejVeN t6mw73k0AcUD5RmKshQn+Vd9WRWAGgBsHUOFvEBvsBPEHnUzdQnZjvzOkOPpqXrDefqi ppCwqPL9nQk4g5DYfMI3wQ4Nx2X4QLHZcjrjpYpes4+UamCIxaAbzDD1xydYhcHJcR5O v7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@citrix.com header.s=securemail header.b=PsMSRXeE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64si14850529oii.266.2020.01.17.07.14.35; Fri, 17 Jan 2020 07:14:47 -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; dkim=fail header.i=@citrix.com header.s=securemail header.b=PsMSRXeE; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=citrix.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729061AbgAQPNf (ORCPT + 99 others); Fri, 17 Jan 2020 10:13:35 -0500 Received: from esa5.hc3370-68.iphmx.com ([216.71.155.168]:19426 "EHLO esa5.hc3370-68.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728739AbgAQPNf (ORCPT ); Fri, 17 Jan 2020 10:13:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1579274014; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=tR8JPZbHUxcZYXs3lZBKPNz8XTBMiBMdbSOleTglRB8=; b=PsMSRXeEGo/JtnRfZ0Wr2+7+X/OBrUWLAHjSAy0lT4OGrPzVTldbCO1c 6JsdTFBB3RUYt8ZVNZOfjaDlolFXsMF0Wlu9XjjT865qkvxqM5RfHWg2d EtUNhHTk8pjFhv87vliSUQ/AosmSnFQ2ueVxRG7tC56Gcj/0kXrFiXAmr Q=; Authentication-Results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=roger.pau@citrix.com; spf=Pass smtp.mailfrom=roger.pau@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of roger.pau@citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa5.hc3370-68.iphmx.com: domain of roger.pau@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="roger.pau@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ip4:168.245.78.127 ~all" Received-SPF: None (esa5.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa5.hc3370-68.iphmx.com; envelope-from="roger.pau@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: MsqHqo/exLDBnrLIXYxKtkRAkIRd8DjhZPa9DS0cCXIi5VRV8F/SHzhPUKSaKvvctb3jOKo46/ Nm6wmJ0zJxkLagzwnNszZjvEsnU/lFq3kluQOaxXk6fMMUQxOwxdelpkuM21DBBOcpGjBW4dv/ kc9WUZeUnFl0Eq41vtfo8XYJD6Kl6jTuxkCBU6XSjgsGcLrks6RH+Bie/lbsWRu3sfbcI2st6q dVrqNu9WhdtryEZERBHTNHTECnHKBii+dEVWkczpONl4H4/1u7OR2f1p0PPyhXCHTCMFA4qFn1 0OY= X-SBRS: 2.7 X-MesageID: 11445514 X-Ironport-Server: esa5.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.70,330,1574139600"; d="scan'208";a="11445514" Date: Fri, 17 Jan 2020 16:13:24 +0100 From: Roger Pau =?iso-8859-1?Q?Monn=E9?= To: Juergen Gross CC: , , , Konrad Rzeszutek Wilk , Boris Ostrovsky , Stefano Stabellini , Jens Axboe Subject: Re: [PATCH] xen/blkfront: limit allocated memory size to actual use case Message-ID: <20200117151324.GS11756@Air-de-Roger> References: <20200117143955.18892-1-jgross@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200117143955.18892-1-jgross@suse.com> X-ClientProxiedBy: AMSPEX02CAS02.citrite.net (10.69.22.113) To AMSPEX02CL01.citrite.net (10.69.22.125) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 17, 2020 at 03:39:55PM +0100, Juergen Gross wrote: > Today the Xen blkfront driver allocates memory for one struct > blkfront_ring_info for each communication ring. This structure is > statically sized for the maximum supported configuration resulting > in a size of more than 90 kB. > > As the main size contributor is one array inside the struct, the > memory allocation can easily be limited by moving this array to be > the last structure element and to allocate only the memory for the > actually needed array size. > > Signed-off-by: Juergen Gross Acked-by: Roger Pau Monn? Thanks! It would be nice to backport this, but I'm not sure it would qualify as a bug fix. Roger.