From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99283C11D05 for ; Thu, 20 Feb 2020 14:28:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 75FA5207FD for ; Thu, 20 Feb 2020 14:28:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 75FA5207FD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 91C776EDA3; Thu, 20 Feb 2020 14:28:04 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 3E53E6EDA3; Thu, 20 Feb 2020 14:28:03 +0000 (UTC) X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Feb 2020 06:28:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,464,1574150400"; d="scan'208";a="349178297" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 20 Feb 2020 06:28:00 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 20 Feb 2020 16:27:59 +0200 Date: Thu, 20 Feb 2020 16:27:59 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: Emil Velikov Subject: Re: [PATCH 00/12] drm: Put drm_display_mode on diet Message-ID: <20200220142759.GA13686@intel.com> References: <20200219203544.31013-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Patchwork-Hint: comment User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Intel Graphics Development , ML dri-devel Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Thu, Feb 20, 2020 at 01:21:03PM +0000, Emil Velikov wrote: > On Wed, 19 Feb 2020 at 20:35, Ville Syrjala > wrote: > > > > From: Ville Syrj=E4l=E4 > > > > struct drm_display_mode is extremely fat. Put it on diet. > > > > Some stats for the whole series: > > > > 64bit sizeof(struct drm_display_mode): > > 200 -> 136 bytes (-32%) > > > > 64bit bloat-o-meter -c drm.ko: > > add/remove: 1/0 grow/shrink: 29/47 up/down: 893/-1544 (-651) > > Function old new delta > > ... > > Total: Before=3D189430, After=3D188779, chg -0.34% > > add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) > > Data old new delta > > Total: Before=3D11667, After=3D11667, chg +0.00% > > add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-16896 (-16896) > > RO Data old new delta > > edid_4k_modes 1000 680 -320 > > edid_est_modes 3400 2312 -1088 > > edid_cea_modes_193 5400 3672 -1728 > > drm_dmt_modes 17600 11968 -5632 > > edid_cea_modes_1 25400 17272 -8128 > > Total: Before=3D71239, After=3D54343, chg -23.72% > > > > > > 64bit bloat-o-meter drm.ko: > > add/remove: 1/0 grow/shrink: 29/52 up/down: 893/-18440 (-17547) > > ... > > Total: Before=3D272336, After=3D254789, chg -6.44% > > > > > > 32bit sizeof(struct drm_display_mode): > > 184 -> 120 bytes (-34%) > > > > 32bit bloat-o-meter -c drm.ko > > add/remove: 1/0 grow/shrink: 19/21 up/down: 743/-1368 (-625) > > Function old new delta > > ... > > Total: Before=3D172359, After=3D171734, chg -0.36% > > add/remove: 0/0 grow/shrink: 0/0 up/down: 0/0 (0) > > Data old new delta > > Total: Before=3D4227, After=3D4227, chg +0.00% > > add/remove: 0/0 grow/shrink: 0/5 up/down: 0/-16896 (-16896) > > RO Data old new delta > > edid_4k_modes 920 600 -320 > > edid_est_modes 3128 2040 -1088 > > edid_cea_modes_193 4968 3240 -1728 > > drm_dmt_modes 16192 10560 -5632 > > edid_cea_modes_1 23368 15240 -8128 > > Total: Before=3D59230, After=3D42334, chg -28.53% > > > > 32bit bloat-o-meter drm.ko: > > add/remove: 1/0 grow/shrink: 19/26 up/down: 743/-18264 (-17521) > > ... > > Total: Before=3D235816, After=3D218295, chg -7.43% > > > > > > Some ideas for further reduction: > > - Convert mode->name to a pointer (saves 24/28 bytes in the > > struct but would often require a heap alloc for the name (though > > typical mode name is <10 bytes so still overall win perhaps) > > - Get rid of mode->name entirely? I guess setcrtc & co. is the only > > place where we have to preserve the user provided name, elsewhere > > could pehaps just generate on demand? Not sure how tricky this > > would get. > = > The series does some great work, with future work reaching the cache > line for 64bit. > Doing much more than that might be an overkill IMHO. > = > In particular, if we change DRM_DISPLAY_MODE_LEN to 24 we get there, > avoiding the heap alloc/calc on demand fun. > While also ensuring the name is sufficiently large for the next decade or= so. Unfortunately it's part of the uabi. So can't change it without some risk of userspace breakage. The least demanding option is probably to nuke export_head. We need one bit to replace it, which we can get by either: - stealing from eg. mode->type, or perhaps mode->private_flags - nuke private_flags outright and replace it with a bool for this purpose -- = Ville Syrj=E4l=E4 Intel _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel