Message ID | 20230108210445.3948344-5-dmitry.osipenko@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1851931wrt; Sun, 8 Jan 2023 13:08:46 -0800 (PST) X-Google-Smtp-Source: AMrXdXvIE30NdnSENhjdWuRhQ5nulLZkcFhEroFeDQUxLoEkUzh9CE//XHWMpPjUtvLuk1CuG2uH X-Received: by 2002:a05:6a21:8dc9:b0:af:5125:bcdd with SMTP id ti9-20020a056a218dc900b000af5125bcddmr23795169pzb.55.1673212125874; Sun, 08 Jan 2023 13:08:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673212125; cv=none; d=google.com; s=arc-20160816; b=t0umxGW5VeBcLvCJbwDHf93FPU7KU6NJGNXFt5yFmyBtznc0DNLHdIZNgCIF75eNjX XeEcyyjV/14LpLp+TFojvRh2e0NBwHV8SH7zn6uxiWTsNhH4l2UTSZxNNHtxanv8zAjL mvGITqg8qNgn05yJ4avCjdWUP+6rQx8cmB/VZ/gnmJL0ogmtzqGFtWkwPKBoGobU1bWY qLM4yyJWRwqKtouoXqfcXd+Y97LYEkAFi8TtBhCwCOIvxVXZiF7VdRCOeC0mYhryfLkS wf9hFoMF1yy8TCzvoZLoiKjRoEwbhgMa2wdIo/jMyi1YEXGZkgkwnjo5eyyt71v42jC0 PCJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4esNUlxp4/XCtfoh6LzVcRv5HrWacewfClNKlFOWqaI=; b=X9CP8dL1sB6nlXf8aDZzYCDPZ+7ACJJ3ncJJi1hxxpmAwBG/JitZxn17wTR31I5+DA CSBrXbMZlzZINn3tMUkwEa3mnC/EIA0gqPjNPWo2Ie5vMrui7/I84EvAhXOMXwvUn4rt 3FvgSiPxsD4/7+WBH/JQKPaZPlCnIbYdHicHjO/d9GU+ZhiumRH7aiH1nPfpsOfcFUPB /U11/XtpA/XB2K9/efCkwNj9NsOQyhFcMNJC4aejRFbBCiVbp4JT4Akmf8z3B4pzAKTY PuDYAdQ2DHAVFzMz/oIn+mvnZztZIw22mhvzeEBq91125yEoxOTXQmYIcEP7lIVL/1KD dPfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=M7ndZjT3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 78-20020a630251000000b0043c3f90f7c8si8184038pgc.655.2023.01.08.13.08.33; Sun, 08 Jan 2023 13:08:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=M7ndZjT3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231926AbjAHVF5 (ORCPT <rfc822;dolce.eric@gmail.com> + 99 others); Sun, 8 Jan 2023 16:05:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55398 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236299AbjAHVFe (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 8 Jan 2023 16:05:34 -0500 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 297E1F033 for <linux-kernel@vger.kernel.org>; Sun, 8 Jan 2023 13:05:33 -0800 (PST) Received: from workpc.. (109-252-117-89.nat.spd-mgts.ru [109.252.117.89]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 910316602D53; Sun, 8 Jan 2023 21:05:25 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1673211931; bh=yM5EklsLIeVBROoe840u6b3fWDQRZvJbUhCX8eobLRI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M7ndZjT3ePxUGP5TzZFQUodhYen26MBCIH+b2Sf5SYIkXVKUsbJngKFISUMTqoLxq fnNPqafIUpxQatwe1QTgvnwzgzk92Ns13EWOnjibLB9wH5h96wk+PQ1aBzn7QlK0t9 /GQe+Yb57/5UtShNRixe+aQ2uR0HF7V6cva+ceygZwwgRX38+fjVNXEATenaq2Pu8Q vgGH/vEeV04lE7Xk9hv6kw6NaHKhgbsAR9/JgovLvhQRy7m05mtWZXyRkp6cbinU5+ hlV16TqFdJXGnZNeQYHh0xchfFOLKTM3qzMSLGaH3fU3BsXnXHjyiix2io0ZE9cQa6 iAahvSDX79akQ== From: Dmitry Osipenko <dmitry.osipenko@collabora.com> To: David Airlie <airlied@gmail.com>, Gerd Hoffmann <kraxel@redhat.com>, Gurchetan Singh <gurchetansingh@chromium.org>, Chia-I Wu <olvaffe@gmail.com>, Daniel Vetter <daniel@ffwll.ch>, Daniel Almeida <daniel.almeida@collabora.com>, Gustavo Padovan <gustavo.padovan@collabora.com>, Daniel Stone <daniel@fooishbar.org>, Tomeu Vizoso <tomeu.vizoso@collabora.com>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Thomas Zimmermann <tzimmermann@suse.de>, Rob Clark <robdclark@gmail.com>, Sumit Semwal <sumit.semwal@linaro.org>, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com>, Qiang Yu <yuq825@gmail.com>, Steven Price <steven.price@arm.com>, Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>, Rob Herring <robh@kernel.org>, Sean Paul <sean@poorly.run>, Dmitry Baryshkov <dmitry.baryshkov@linaro.org>, Abhinav Kumar <quic_abhinavk@quicinc.com> Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@collabora.com, virtualization@lists.linux-foundation.org Subject: [PATCH v10 04/11] drm/shmem: Put booleans in the end of struct drm_gem_shmem_object Date: Mon, 9 Jan 2023 00:04:38 +0300 Message-Id: <20230108210445.3948344-5-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230108210445.3948344-1-dmitry.osipenko@collabora.com> References: <20230108210445.3948344-1-dmitry.osipenko@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754490078233137913?= X-GMAIL-MSGID: =?utf-8?q?1754490078233137913?= |
Series |
Add generic memory shrinker to VirtIO-GPU and Panfrost DRM drivers
|
|
Commit Message
Dmitry Osipenko
Jan. 8, 2023, 9:04 p.m. UTC
Group all 1-bit boolean members of struct drm_gem_shmem_object in the end
of the structure, allowing compiler to pack data better and making code to
look more consistent.
Suggested-by: Thomas Zimmermann <tzimmermann@suse.de>
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
include/drm/drm_gem_shmem_helper.h | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
Comments
Am 08.01.23 um 22:04 schrieb Dmitry Osipenko: > Group all 1-bit boolean members of struct drm_gem_shmem_object in the end > of the structure, allowing compiler to pack data better and making code to > look more consistent. > > Suggested-by: Thomas Zimmermann <tzimmermann@suse.de> > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de> > --- > include/drm/drm_gem_shmem_helper.h | 30 +++++++++++++++--------------- > 1 file changed, 15 insertions(+), 15 deletions(-) > > diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h > index a2201b2488c5..5994fed5e327 100644 > --- a/include/drm/drm_gem_shmem_helper.h > +++ b/include/drm/drm_gem_shmem_helper.h > @@ -60,20 +60,6 @@ struct drm_gem_shmem_object { > */ > struct list_head madv_list; > > - /** > - * @pages_mark_dirty_on_put: > - * > - * Mark pages as dirty when they are put. > - */ > - unsigned int pages_mark_dirty_on_put : 1; > - > - /** > - * @pages_mark_accessed_on_put: > - * > - * Mark pages as accessed when they are put. > - */ > - unsigned int pages_mark_accessed_on_put : 1; > - > /** > * @sgt: Scatter/gather table for imported PRIME buffers > */ > @@ -97,10 +83,24 @@ struct drm_gem_shmem_object { > */ > unsigned int vmap_use_count; > > + /** > + * @pages_mark_dirty_on_put: > + * > + * Mark pages as dirty when they are put. > + */ > + bool pages_mark_dirty_on_put : 1; > + > + /** > + * @pages_mark_accessed_on_put: > + * > + * Mark pages as accessed when they are put. > + */ > + bool pages_mark_accessed_on_put : 1; > + > /** > * @map_wc: map object write-combined (instead of using shmem defaults). > */ > - bool map_wc; > + bool map_wc : 1; > }; > > #define to_drm_gem_shmem_obj(obj) \ -- Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 Nürnberg, Germany (HRB 36809, AG Nürnberg) Geschäftsführer: Ivo Totev
diff --git a/include/drm/drm_gem_shmem_helper.h b/include/drm/drm_gem_shmem_helper.h index a2201b2488c5..5994fed5e327 100644 --- a/include/drm/drm_gem_shmem_helper.h +++ b/include/drm/drm_gem_shmem_helper.h @@ -60,20 +60,6 @@ struct drm_gem_shmem_object { */ struct list_head madv_list; - /** - * @pages_mark_dirty_on_put: - * - * Mark pages as dirty when they are put. - */ - unsigned int pages_mark_dirty_on_put : 1; - - /** - * @pages_mark_accessed_on_put: - * - * Mark pages as accessed when they are put. - */ - unsigned int pages_mark_accessed_on_put : 1; - /** * @sgt: Scatter/gather table for imported PRIME buffers */ @@ -97,10 +83,24 @@ struct drm_gem_shmem_object { */ unsigned int vmap_use_count; + /** + * @pages_mark_dirty_on_put: + * + * Mark pages as dirty when they are put. + */ + bool pages_mark_dirty_on_put : 1; + + /** + * @pages_mark_accessed_on_put: + * + * Mark pages as accessed when they are put. + */ + bool pages_mark_accessed_on_put : 1; + /** * @map_wc: map object write-combined (instead of using shmem defaults). */ - bool map_wc; + bool map_wc : 1; }; #define to_drm_gem_shmem_obj(obj) \