public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
Cc: torvalds@osdl.org, linux-kernel@vger.kernel.org, rohit.seth@intel.com
Subject: Re: [PATCH] Reading deterministic cache parameters and exporting it in /sysfs
Date: Tue, 15 Mar 2005 23:07:36 -0800	[thread overview]
Message-ID: <20050315230736.6faa3734.akpm@osdl.org> (raw)
In-Reply-To: <20050315152448.A1697@unix-os.sc.intel.com>

Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> wrote:
>
>  The attached patch adds support for using cpuid(4) instead of cpuid(2), to get 
>  CPU cache information in a deterministic way for Intel CPUs, whenever 
>  supported.

- find_num_cache_leaves can be marked __init

- Please look for other __init opportunities.  That's quite a lot of code.

- Some functions have a space before the ( and some don't:

	+static ssize_t show_size (struct _cpuid4_info *this_leaf, char *buf)

  omitting the space is preferred.

- Don't cast the return value of kmalloc:

+	cpuid4_info[cpu] = (struct _cpuid4_info *)kmalloc(
+	    sizeof(struct _cpuid4_info) * num_cache_leaves, GFP_KERNEL);

- Sometimes there's a space after an `if', sometimes not.

+		if(cpuid4_info[i])

  a space is preferred.

- kfree(NULL) is permitted:

+	if(cpuid4_info[i])
+		kfree(cpuid4_info[i]);
+	if(cache_kobject[i])
+		kfree(cache_kobject[i]);
+	if(index_kobject[i])
+		kfree(index_kobject[i]);

  (in several places)


Once you've worked through the design issues with davej, please upissue the
patch, thanks.


  parent reply	other threads:[~2005-03-16  7:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-15 23:24 [PATCH] Reading deterministic cache parameters and exporting it in /sysfs Venkatesh Pallipadi
2005-03-15 23:36 ` Dave Jones
2005-03-16  0:10   ` Venkatesh Pallipadi
2005-03-16 10:29   ` Daniel Egger
2005-03-16  7:07 ` Andrew Morton [this message]
2005-03-18 19:18   ` Venkatesh Pallipadi
2005-03-18 19:46     ` Dave Jones

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=20050315230736.6faa3734.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rohit.seth@intel.com \
    --cc=torvalds@osdl.org \
    --cc=venkatesh.pallipadi@intel.com \
    /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