From: Reinette Chatre <reinette.chatre@intel.com>
To: "Wieczor-Retman, Maciej" <maciej.wieczor-retman@intel.com>,
<linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
<shuah@kernel.org>, <fenghua.yu@intel.com>
Cc: <ilpo.jarvinen@linux.intel.com>
Subject: Re: [PATCH v2 1/2] selftests/resctrl: Fix schemata write error check
Date: Wed, 30 Aug 2023 13:49:18 -0700 [thread overview]
Message-ID: <57f891d8-09f9-fe5d-fa85-0669f5e8d1ce@intel.com> (raw)
In-Reply-To: <6c263fdd2b09060e667d179be13ce8f989821673.1693213468.git.maciej.wieczor-retman@intel.com>
Hi Maciej,
On 8/28/2023 2:56 AM, Wieczor-Retman, Maciej wrote:
> Writing bitmasks to the schemata can fail when the bitmask doesn't
> adhere to some constraints defined by what a particular CPU supports.
> Some example of constraints are max length or having contiguous bits.
> The driver should properly return errors when any rule concerning
> bitmask format is broken.
>
> Resctrl FS returns error codes from fprintf() only when fclose() is
> called. Current error checking scheme allows invalid bitmasks to be
> written into schemata file and the selftest doesn't notice because the
> fclose() error code isn't checked.
>
> Substitute fopen(), flose() and fprintf() with open(), close() and
> write() to avoid error code buffering between fprintf() and fclose().
>
> Add newline to the end of the schema string so it satisfies rdt
> schemata writing requirements.
I am not sure how to interpret the above because existing code already
adds a newline to the end of the schema when the buffer is written to
the schemata file. Also please use "resctrl schemata" since RDT is
Intel specific and does not use schemata terminology.
>
> Remove newline character from the schemat string after writing it to
> the schemata file so it prints correctly before function return.
schemat -> "schema" or "schemata"?
> Pass the string generated with strerror() to the "reason" buffer so
> the error message is more verbose. Extend "reason" buffer so it can hold
> longer messages.
>
> Changelog v2:
> - Rewrite patch message.
> - Double "reason" buffer size to fit longer error explanation.
> - Redo file interactions with syscalls instead of stdio functions.
>
Please place the above "Changelog v2" snippet below the "---" lines below.
This is text that should not end up in the kernel log.
> Signed-off-by: Wieczor-Retman, Maciej <maciej.wieczor-retman@intel.com>
> ---
(list of changes should go here)
Reinette
Reinette
next prev parent reply other threads:[~2023-08-30 20:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-28 9:56 [PATCH v2 0/2] selftests/resctrl: Bug fix and optimizations Wieczor-Retman, Maciej
2023-08-28 9:56 ` [PATCH v2 1/2] selftests/resctrl: Fix schemata write error check Wieczor-Retman, Maciej
2023-08-28 10:43 ` Ilpo Järvinen
2023-08-28 12:55 ` Maciej Wieczór-Retman
2023-08-30 20:49 ` Reinette Chatre [this message]
2023-08-31 8:06 ` Maciej Wieczór-Retman
2023-08-28 9:56 ` [PATCH v2 2/2] selftests/resctrl: Move run_benchmark() to a more fitting file Wieczor-Retman, Maciej
2023-08-28 10:47 ` Ilpo Järvinen
2023-08-30 20:51 ` Reinette Chatre
2023-08-31 8:43 ` Maciej Wieczór-Retman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=57f891d8-09f9-fe5d-fa85-0669f5e8d1ce@intel.com \
--to=reinette.chatre@intel.com \
--cc=fenghua.yu@intel.com \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maciej.wieczor-retman@intel.com \
--cc=shuah@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.