kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: ngwilliams@gmail.com (Nathan Williams)
To: kernelnewbies@lists.kernelnewbies.org
Subject: What is the point of this function?
Date: Tue, 21 Jun 2016 12:31:54 +1000	[thread overview]
Message-ID: <1466476314.28067.8.camel@linux> (raw)
In-Reply-To: <CAPQXMLFvDqbRKfpyqy+yfG8HUyFra3JuX3bmMqhgtV-OTw_Umg@mail.gmail.com>

On Tue, 2016-06-21 at 00:48 +0200, Andrea Benelli wrote:
> Hello, i was looking at the linux/sched.h (kernel version 4.6.2)
> source code and i found this function at line 1174: 
> 
> static inline bool cpus_share_cache(int this_cpu, int that_cpu)
> {
>         return true;
> }
> 
> I'm not able to understand the utility of a function that just return
> a true value. 
> i've noticed that there are a lot of functions like this (function
> that just return a constant). 

Hi Andrea,

That's the case for when CONFIG_SMP isn't defined. What happens when
CONFIG_SMP is defined?

I suggest having a look through the code with a Linux cross reference:

http://lxr.free-electrons.com/ident?v=4.6;i=cpus_share_cache

Regards,
Nathan

  reply	other threads:[~2016-06-21  2:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAPQXMLHzXhKzZyZx_0YWZMkr6MdPNDdd38Fh=vabGcRMcKXXjw@mail.gmail.com>
2016-06-20 22:48 ` What is the point of this function? Andrea Benelli
2016-06-21  2:31   ` Nathan Williams [this message]
2016-06-21 11:56     ` Andrea Benelli
2016-06-22 13:08       ` Daniel.
2016-06-23  7:58         ` Andrea Benelli

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=1466476314.28067.8.camel@linux \
    --to=ngwilliams@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).