From: gregkh@linuxfoundation.org (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Change proc/<pid>/cmdline to 8k
Date: Fri, 5 Jun 2015 07:07:30 +0900 [thread overview]
Message-ID: <20150604220730.GA5667@kroah.com> (raw)
In-Reply-To: <CAA=4085a+TfEwBtBwsn5tdX6sMLRVZwH45h2RP_WQCVHzs3U1A@mail.gmail.com>
On Thu, Jun 04, 2015 at 09:06:10PM +0530, Navin P wrote:
> On Thu, Jun 4, 2015 at 1:34 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Thu, Jun 04, 2015 at 01:11:48PM +0530, Navin P wrote:
> >> On Thu, Jun 4, 2015 at 10:47 AM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > On Thu, Jun 04, 2015 at 09:52:08AM +0530, Navin P wrote:
> >> >> Hi,
> >> >>
> >> >> I want to change the cmdline of a process to support 8096 . It works
> >> >> well on ppc where the page size is 65k.
> >> >> But when i try to increase it on x86 (i686)
> >> >>
> >> >> http://lxr.free-electrons.com/source/fs/proc/base.c by doing
> >> >> 6*PAGE_SIZE, i get kernel panic after some time
> >> >>
> >> >> 199 static int proc_pid_cmdline(struct seq_file *m, struct pid_namespace *ns,
> >> >> 200 struct pid *pid, struct task_struct *task)
> >> >> 201 {
> >> >> 202 /*
> >> >> 203 * Rely on struct seq_operations::show() being called once
> >> >> 204 * per internal buffer allocation. See single_open(), traverse().
> >> >> 205 */
> >> >> 206 BUG_ON(m->size < PAGE_SIZE);
> >> >> 207 m->count += get_cmdline(task, m->buf, 6*PAGE_SIZE);
> >> >> 208 return 0;
> >> >> 209 }
> >> >> 210
> >> >
> >> > That shows you that this will not work, sorry.
> >>
> >> Can you please help me and guide me into achieving this ?
> >
> > Why do you want this? What problem are you trying to solve that you
> > have come to the conclusion that increasing the size of the command line
> > is the solution?
> >
> I'm trying to learn things so that default cmd linux across all
> distributions for ia64 and ppc which has PAGE_SIZE has 64k works . We
> have this 3rd party application with deeply mounted dir that runs as a
> testcase more than 5k chars .
Applications shouldn't be messing around with the kernel command line.
> We can change it , i thought if that was
> the problem ? So just trying to learn. I tried changing the PAGE_SHIFT
> but that made the kernel non-bootable or stuck at booting.
You can not easily, if at all, change the PAGE_SIZE of an architecture.
That is a non-trivial task that takes a ton of knowledge about the
platform.
> This panics only when you access the pid with more than 4k chars.
A pid is a number, not a string. What do you mean by "pid" in this
context?
greg k-h
next prev parent reply other threads:[~2015-06-04 22:07 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 4:22 Change proc/<pid>/cmdline to 8k Navin P
2015-06-04 5:17 ` Greg KH
2015-06-04 7:41 ` Navin P
2015-06-04 8:04 ` Greg KH
2015-06-04 15:36 ` Navin P
2015-06-04 22:07 ` Greg KH [this message]
2015-06-04 22:18 ` Valdis.Kletnieks at vt.edu
2015-06-04 22:38 ` Greg KH
2015-06-04 22:19 ` Valdis.Kletnieks at vt.edu
2015-06-05 3:21 ` Navin P
2015-06-16 10:34 ` Navin P
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=20150604220730.GA5667@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=kernelnewbies@lists.kernelnewbies.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.