public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Petri Latvala <petri.latvala@intel.com>
To: Caz Yokoyama <caz.yokoyama@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t v2 1/1] lib: consolidate duplicated define of vfs_file_max(void)
Date: Thu, 25 Apr 2019 12:32:30 +0300	[thread overview]
Message-ID: <20190425093230.GZ22949@platvala-desk.ger.corp.intel.com> (raw)
In-Reply-To: <0ad78d67c33397fe3008e30d4cf7889557a94514.1556119823.git.caz.yokoyama@intel.com>

On Wed, Apr 24, 2019 at 08:31:29AM -0700, Caz Yokoyama wrote:
> Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> ---
>  lib/igt_aux.c               | 21 +++++++++++++++++++++
>  lib/igt_aux.h               |  2 ++
>  lib/intel_os.c              | 14 --------------
>  tests/i915/gem_exec_reuse.c | 14 +-------------
>  4 files changed, 24 insertions(+), 27 deletions(-)
> 
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 05528352..6516a6d6 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -1615,3 +1615,24 @@ bool igt_allow_unlimited_files(void)
>  	rlim.rlim_max = nofile_rlim;
>  	return setrlimit(RLIMIT_NOFILE, &rlim) == 0;
>  }
> +
> +/*
> + * vfs_file_max: report maximum number of files
> + *
> + * By reading /proc/sys/fs/file-max, it returns maximum number of files kernel
> + * allows to have at the same time. It may returns 80000 or assert failure
> + * on error.
> + */

The documentation comment block needs to begin with  /**  (two asterisks).

Use the Returns: keyword to describe the return value semantics.

A wording change suggestion:

/**
 * vfs_file_max: get system-wide limit of open files
 *
 * Get the global system-wide maximum of open files the kernel allows,
 * by reading /proc/sys/fs/file-max. Fails the current subtest if
 * reading the file fails, and returns a suitable best guess if it
 * cannot be opened.
 *
 * Returns: System-wide maximum of open files, or a best effort guess.
 */


to better emphasise that it's the system-wide max, not nr_open. A
distinction that has already bitten us.

What do you think?


(When is there ever a case when the file can be opened but reading
fails?)



-- 
Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-04-25  9:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 15:31 [igt-dev] [PATCH i-g-t v2 1/1] lib: consolidate duplicated define of vfs_file_max(void) Caz Yokoyama
2019-04-24 18:37 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v2,1/1] " Patchwork
2019-04-25  4:16 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-04-25  9:32 ` Petri Latvala [this message]
2019-04-25 17:23   ` [igt-dev] [PATCH i-g-t v2 1/1] " Caz Yokoyama

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=20190425093230.GZ22949@platvala-desk.ger.corp.intel.com \
    --to=petri.latvala@intel.com \
    --cc=caz.yokoyama@intel.com \
    --cc=igt-dev@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox