public inbox for linux-newbie@vger.kernel.org
 help / color / mirror / Atom feed
From: Korkakakis Nikos <korkakak@ceid.upatras.gr>
To: linux-newbie@vger.kernel.org
Subject: questions; gcc builtins - IO scheduler - profiling
Date: Tue, 28 Apr 2009 09:24:52 +0300	[thread overview]
Message-ID: <49F6A134.4020308@ceid.upatras.gr> (raw)

Hi all,

since I have played a bit with the kernel sources these are some newbie
questions, that I couldn't find with trivial search engine usage;

a) It is possible to use gcc builtin functions in conjuction with some
gcc switches and the march to produce somewhat optimal code. For
instance function __builtin_popcount, together with the march=amdfam10
and -mabm produces a POPCNT assembly instruction which counts the bits
on word (machine word) in 1 instruction. For archs that does not support
the popcnt instruction  as far as I can tell gcc produces
/normal-expected/ code that does the same thing in a simple (using a
loop, shifting and counting Zero-Flags) or a more advanced way ().  Is
such programming practice condemned?

b) One of the coolest things in kernel is the different types of I/O
schedulers. I haven't exhaustively checked the source but is it possible
to have a differnet I/O scheduler per device? If for instance I have an
SSD and a normal hdd wouldn't be cooler to use noop I/O Sched for the
SSD  and anticipatory I/O Sched for the normal hdd?

c) Is there a way to profile *just* one specific module/function/group
of functions that run as a kernel thread for runtime performance? So far
I've (tried to) used (use) oprofile (http://oprofile.sf.net) for some
profiling and it is quite disturbing ( can't see the tree for the forest
:P ).


Cheers :)
--
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

                 reply	other threads:[~2009-04-28  6:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=49F6A134.4020308@ceid.upatras.gr \
    --to=korkakak@ceid.upatras.gr \
    --cc=linux-newbie@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