Message ID | 20220624080444.7619-6-christian.koenig@amd.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7768C43334 for <linux-mm@archiver.kernel.org>; Fri, 24 Jun 2022 08:04:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D8E7F8E01F4; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CF1678E01F3; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B416E8E01F4; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 9C4ED8E01F3 for <linux-mm@kvack.org>; Fri, 24 Jun 2022 04:04:55 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 73155342A8 for <linux-mm@kvack.org>; Fri, 24 Jun 2022 08:04:55 +0000 (UTC) X-FDA: 79612393350.13.497DEF9 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by imf26.hostedemail.com (Postfix) with ESMTP id 17FF0140012 for <linux-mm@kvack.org>; Fri, 24 Jun 2022 08:04:54 +0000 (UTC) Received: by mail-ed1-f50.google.com with SMTP id e40so2341785eda.2 for <linux-mm@kvack.org>; Fri, 24 Jun 2022 01:04:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=CjcSe9wc4EjfAkbjkiF8NJM6p2V4TBIzx/MVoQMmpgiPsjLyR+gRuRTFEYB3Ktsmj6 uDAJoHxOnz8/QuPN6vTSy5gLwbvZIrxGeq6qoPabZTcRU6gXi4B9UgKRuVNDxdOuXcL1 cxd/73iXXQR+fr9ZjFoDFmjR0cLQM1R0DIR2jGAJPqHq78r8H+21zwbEgz340DrDdfqf X5N2BIdOCyjdEdUdAOIQhfOYFDl6u7OALHxEmKZyWH8er7gOe7gpZJPRqEWHVjjT+Zda LFVWx/ojsAy6fLSK9XLReier7Yc/aQFSo1vJ6Ffb4pLtiw1aDQ3/hGk/ftltPnqcfrJN mArQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=OrkOpjWRsChzB49hZnZp2dshiMkgjUoMSvxsj83CPh78hJIUSNphAnSbRwG66ZVzzX mR32i9NYFTqR+YXtLGkljP7ct4BUjpNhnYmS32ZcycOBpgYJJtDjTVfs0VzvV5EuTMig JYUjx2sIMU/ZPl3lDP11O8yI0RaC64Vml7IjFGTiBOs62A1OESMksk6WoRd07a4lW0hg AEo14q43tOEy02diw7qKiW8te30CEcxLom2wd8LQ7nVDE2MsO9juAGKQWgFrL3ZlfxCP vNI9RLMPkVTnjAT1QJjSrzAFTYF9f2IucI9F/mYszOyUb81QJ12c/Kk5sRaryCSX/Orx r+ow== X-Gm-Message-State: AJIora97NLOnUEpH3/6LYc86frKKWyoEEmrN2UWgSKke9sXQpur7TZwN ab1itJuNE6xtLrLx/TTnvQY= X-Google-Smtp-Source: AGRyM1tBvj71cbsgZ5j4wXJcKfxDt7AmGXAvH0woqtRU4by1QVnuj6MIlbtq+6gf5TBsdwCsD9lmDQ== X-Received: by 2002:aa7:d296:0:b0:435:7f33:38bc with SMTP id w22-20020aa7d296000000b004357f3338bcmr15804834edq.399.1656057893977; Fri, 24 Jun 2022 01:04:53 -0700 (PDT) Received: from able.fritz.box (p57b0bd9f.dip0.t-ipconnect.de. [87.176.189.159]) by smtp.gmail.com with ESMTPSA id c19-20020a170906155300b006fea43db5c1sm697779ejd.21.2022.06.24.01.04.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jun 2022 01:04:53 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " <ckoenig.leichtzumerken@gmail.com> X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com> To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, dri-devel@lists.freedesktop.org Cc: mhocko@suse.com, =?utf-8?q?Christian_K=C3=B6nig?= <christian.koenig@amd.com> Subject: [PATCH 05/14] dma-buf: provide file RSS for DMA-buf files Date: Fri, 24 Jun 2022 10:04:35 +0200 Message-Id: <20220624080444.7619-6-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220624080444.7619-1-christian.koenig@amd.com> References: <20220624080444.7619-1-christian.koenig@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656057895; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=SN2tXnkiXYHDkRcNluGEiWD+Zcie7EgTba4v+LS00Rw=; b=M9ynHXTUBEJhfm6cjVyfXxM/MAgzFTBWPjJRYhpz4V5kiuy+v7NKTAqDQwZavtmYBWAjqg ZGYSQjY96A9O5RtwUtop/LUuNMSNYmksLR0PkoE91pGOl6nx4NprL2HR+2Viw8P7d9RTkQ cA+khwk3WG5rmTdUC+a/S+M+Dcq1wG8= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CjcSe9wc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656057895; a=rsa-sha256; cv=none; b=rRAxOVbCdi5cLalEJzEN2RpDqng69zmOLjs2jof5lQMunQY3heYz7KVrH5srmab3DaCOD2 SAMzB+C0+1ze0EHymDXLI28DT2QmTieAlUdOAD0CbAXuMxTZIV/8qKHJoE+vx4kGdGatws KJHxY3q0zAkTmaQfuBI56DEX43aoCck= X-Rspamd-Queue-Id: 17FF0140012 Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=CjcSe9wc; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf26.hostedemail.com: domain of ckoenig.leichtzumerken@gmail.com designates 209.85.208.50 as permitted sender) smtp.mailfrom=ckoenig.leichtzumerken@gmail.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: wp9wd75p19tnatgfxciptpwgxrbxtewx X-HE-Tag: 1656057894-446982 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> |
Series |
[01/14] fs: add per file RSS
|
expand
|
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c index 630133284e2b..16162ec3538c 100644 --- a/drivers/dma-buf/dma-buf.c +++ b/drivers/dma-buf/dma-buf.c @@ -494,6 +494,11 @@ static void dma_buf_show_fdinfo(struct seq_file *m, struct file *file) spin_unlock(&dmabuf->name_lock); } +static long dma_buf_file_rss(struct file *file) +{ + return i_size_read(file_inode(file)) >> PAGE_SHIFT; +} + static const struct file_operations dma_buf_fops = { .release = dma_buf_file_release, .mmap = dma_buf_mmap_internal, @@ -502,6 +507,7 @@ static const struct file_operations dma_buf_fops = { .unlocked_ioctl = dma_buf_ioctl, .compat_ioctl = compat_ptr_ioctl, .show_fdinfo = dma_buf_show_fdinfo, + .file_rss = dma_buf_file_rss, }; /*
Just return the size of the DMA-buf in pages since pages allocated or mapped through DMA-bufs are usually not accounted elsewhere. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/dma-buf/dma-buf.c | 6 ++++++ 1 file changed, 6 insertions(+)