summaryrefslogtreecommitdiff
path: root/drivers/misc/mei/debugfs.c
diff options
context:
space:
mode:
authorAlexander Usyskin <alexander.usyskin@intel.com>2018-02-25 21:07:05 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-03-14 21:33:13 +0300
commitaf336cabe08363ba8493e7d7e5d070353eb30caa (patch)
tree003025b642d6dcfab2a2f5ba220ce69ee69def65 /drivers/misc/mei/debugfs.c
parent257355a44b9929e55d6fd47bfff66971dc4de948 (diff)
downloadlinux-af336cabe08363ba8493e7d7e5d070353eb30caa.tar.xz
mei: limit the number of queued writes
Limit the number of queued writes per client. Writes above this threshold are blocked till place in the transmit queue is available. The limit is configurable via sysfs and defaults to 50. The implementation should provide blocking I/O behavior. Prior to this change one would end up in the hands of OOM. Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/misc/mei/debugfs.c')
-rw-r--r--drivers/misc/mei/debugfs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c
index a617aa5a3ad8..c815da91089c 100644
--- a/drivers/misc/mei/debugfs.c
+++ b/drivers/misc/mei/debugfs.c
@@ -97,7 +97,7 @@ static ssize_t mei_dbgfs_read_active(struct file *fp, char __user *ubuf,
int pos = 0;
int ret;
-#define HDR " |me|host|state|rd|wr|\n"
+#define HDR " |me|host|state|rd|wr|wrq\n"
if (!dev)
return -ENODEV;
@@ -130,9 +130,10 @@ static ssize_t mei_dbgfs_read_active(struct file *fp, char __user *ubuf,
list_for_each_entry(cl, &dev->file_list, link) {
pos += scnprintf(buf + pos, bufsz - pos,
- "%3d|%2d|%4d|%5d|%2d|%2d|\n",
+ "%3d|%2d|%4d|%5d|%2d|%2d|%3u\n",
i, mei_cl_me_id(cl), cl->host_client_id, cl->state,
- !list_empty(&cl->rd_completed), cl->writing_state);
+ !list_empty(&cl->rd_completed), cl->writing_state,
+ cl->tx_cb_queued);
i++;
}
out: