public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Peng Tao <bergwolf@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andreas Dilger <andreas.dilger@intel.com>
Subject: Re: [PATCH 2/4] staging/lustre/obdclass: read jobid from proc
Date: Wed, 30 Oct 2013 07:20:17 -0700	[thread overview]
Message-ID: <20131030142017.GB30896@kroah.com> (raw)
In-Reply-To: <CA+a=Yy6rL6CV3THZ4Mr4oHqVDiejr++r9Oa4kro4Y_CCbFEfEQ@mail.gmail.com>

On Wed, Oct 30, 2013 at 09:31:24PM +0800, Peng Tao wrote:
> On Wed, Oct 30, 2013 at 9:21 PM, Greg Kroah-Hartman
> <gregkh@linuxfoundation.org> wrote:
> > On Wed, Oct 30, 2013 at 07:30:34PM +0800, Peng Tao wrote:
> >> so that we can get rid of cfs_get_environ() that needs access_process_vm() that
> >> is a core mm function and is not available on some architectures.
> >>
> >> Reviewed-by: Niu Yawei <yawei.niu@intel.com>
> >> Signed-off-by: Peng Tao <bergwolf@gmail.com>
> >> Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
> >> ---
> >>  drivers/staging/lustre/lustre/obdclass/class_obd.c |  119 +++++++++++++++++++-
> >>  1 file changed, 115 insertions(+), 4 deletions(-)
> >>
> >> diff --git a/drivers/staging/lustre/lustre/obdclass/class_obd.c b/drivers/staging/lustre/lustre/obdclass/class_obd.c
> >> index b1024a6..99ce863 100644
> >> --- a/drivers/staging/lustre/lustre/obdclass/class_obd.c
> >> +++ b/drivers/staging/lustre/lustre/obdclass/class_obd.c
> >> @@ -96,8 +96,117 @@ EXPORT_SYMBOL(obd_dirty_transit_pages);
> >>  char obd_jobid_var[JOBSTATS_JOBID_VAR_MAX_LEN + 1] = JOBSTATS_DISABLE;
> >>  EXPORT_SYMBOL(obd_jobid_var);
> >>
> >> -/* Get jobid of current process by reading the environment variable
> >> - * stored in between the "env_start" & "env_end" of task struct.
> >> +static char *self_environ_file = "/proc/self/environ";
> >
> > Heh, no, that's not ok at all.
> >
> > This is a _huge_ sign that you are doing something wrong in your driver
> > if you need something that isn't exported, or that you have to dig out
> > of proc.
> >
> Lustre has a functionality that lets applications specify a global
> jobid by setting the same environment variable across the cluster and
> thus server can trace IO that is issued by different job. Currently it
> is implemented by having a private version of cfs_access_process_vm
> because access_process_vm is not exported. The patch intends to change
> it to reading from proc. If we cannot dig it out from proc either, how
> can we keep the functionality then? Please advise.

Kernel code should not care about environment variables.  Just because
you created a crazy requirement, does not mean it is a valid one, nor
that I have to be the one to tell you how to implement it.

I'm never going to take code that parses proc files, you all know better
than that.

greg k-h

  reply	other threads:[~2013-10-30 14:18 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-30 11:30 [PATCH 1/4] staging/lustre/llite: cache jobid in lu_env Peng Tao
2013-10-30 11:30 ` [PATCH 2/4] staging/lustre/obdclass: read jobid from proc Peng Tao
2013-10-30 13:21   ` Greg Kroah-Hartman
2013-10-30 13:31     ` Peng Tao
2013-10-30 14:20       ` Greg Kroah-Hartman [this message]
2013-10-30 15:15         ` Peng Tao
2014-02-04  6:12     ` Oleg Drokin
2014-02-04 16:57       ` Greg Kroah-Hartman
2014-02-04 17:27         ` Oleg Drokin
2013-10-30 11:30 ` [PATCH 3/4] staging/lustre: remove cfs_get_environ and cfs_access_process_vm Peng Tao
2013-10-30 11:30 ` [PATCH 4/4] staging/lustre: enable build on MIPS/XTENSA/SUPERH Peng Tao
2013-10-30 13:19 ` [PATCH 1/4] staging/lustre/llite: cache jobid in lu_env Greg Kroah-Hartman

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=20131030142017.GB30896@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=andreas.dilger@intel.com \
    --cc=bergwolf@gmail.com \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox