mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Russ Dill" <russ.dill@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: [OT] Argument with an OS professor over profile=3
Date: Wed, 10 Oct 2007 17:08:05 -0700	[thread overview]
Message-ID: <f9d2a5e10710101708l707eb619l6446f2e648ee016e@mail.gmail.com> (raw)

I've been having a back and forth going for a while with my TA and OS
professor on the meaning of profile=3 and have been unable to convince
either of them. The basic question is if profile=3 is passed to kernel
with an 8MB text section, how big is the allocated profile buffer. His
answer is 1MB....

        if (prof_shift) {
                unsigned int size;
                /* only text is profiled */
                prof_len = (unsigned *) &_etext - (unsigned *) &_stext;
                prof_len >>= prof_shift;

                size = prof_len * sizeof(unsigned int) + PAGE_SIZE-1;
                prof_buffer = (unsigned int *) alloc_bootmem(size);
        }

I've booted linux with profile=3 and pointed to the dmesg output. I've
copied the code out of init/main.c into a test program and run it.
I've even pointed to the comment in the Makefile for linux-0.98. He
seems to think that there is pointer arithmetic taking place. To make
matters worse, our textbook "Linux Core Kernel Commentary, 2nd
Edition", also has an incorrect answer. It states "A prof_shift value
of 2, for example, allocates an amount of memory equal to 25 percent
of the kernel's code size to profile the kernel." And of  course, he's
been giving the exam for 4 years and no one else complained.

Anyway, a reply from whoever sent this message back in 1992:

http://groups.google.com/group/comp.os.linux/browse_thread/thread/d84462f394d3a206/dfee60779481ccec?lnk=st&q=&rnum=4#dfee60779481ccec

> I wrote a kernel profiling utility for this, and sent the patches
> (small) and a user-level program to print out results (even smaller) to
> the kernel mailing-list.  If anybody sees this slow-down problem, and
> tries out the profiling code, I'd be interested to have some sample
> output.
>
> If you aren't on the kernel list, I can make the patches available on
> the net.

would be nice. I heard he had arguments with his OS prof's back in the
day. (even neater if someone had the email that was sent to whatever
that kernel list was, just for my general curiosity), but emails from
others would be nice too :)




A few secondary questions that aren't nearly as important. Is IRQ used
an abbreviation for interrupt, or does it have a separate meaning to
kernel developers?

Rate the following responses on a scale from 1-10:

Why does the source code use 14 calls to BUILD_16_IRQS each of which
makes 16 calls to BI (which expands to BUILD_IRQ) instead of 224 calls
to BUILD_IRQ?

Reduce amount of source code and redundancy

224 calls would be ugly and difficult to maintain. Plus, kernel
developers are lazv, they don't want to have to copy&paste 224 times.

Thanks, I work full time and attend graduate school full time, I've
already spent far too much time arguing with my prof and TA.

             reply	other threads:[~2007-10-11  0:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-11  0:08 Russ Dill [this message]
2007-10-11  0:13 ` Russ Dill
2007-10-11  0:17   ` Jan Engelhardt
2007-10-11  1:36 ` David Newall
2007-10-11  1:50   ` Russ Dill

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=f9d2a5e10710101708l707eb619l6446f2e648ee016e@mail.gmail.com \
    --to=russ.dill@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

all inboxes | Powered by JetHome®