public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Nishanth Aravamudan <nacc@linux•vnet.ibm.com>
To: Jiang Liu <jiang.liu@linux•intel.com>
Cc: Peter Zijlstra <peterz@infradead•org>,
	linux-hotplug@vger•kernel.org, linux-mm@kvack•org,
	Mike Galbraith <umgwanakikbuti@gmail•com>,
	e1000-devel@lists•sourceforge.net,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel•com>,
	Jesse Brandeburg <jesse.brandeburg@intel•com>,
	Mel Gorman <mgorman@suse•de>,
	David Rientjes <rientjes@google•com>,
	Linux NICS <linux.nics@intel•com>,
	Tony Luck <tony.luck@intel•com>,
	netdev@vger•kernel.org, Bruce Allan <bruce.w.allan@intel•com>,
	linux-kernel@vger•kernel.org,
	John Ronciak <john.ronciak@intel•com>,
	Andrew Morton <akpm@linux-foundation•org>
Subject: Re: [RFC Patch V1 15/30] mm, igb: Use cpu_to_mem()/numa_mem_id() to support memoryless node
Date: Mon, 21 Jul 2014 10:42:18 -0700	[thread overview]
Message-ID: <20140721174218.GD4156@linux.vnet.ibm.com> (raw)
In-Reply-To: <1405064267-11678-16-git-send-email-jiang.liu@linux.intel.com>

On 11.07.2014 [15:37:32 +0800], Jiang Liu wrote:
> When CONFIG_HAVE_MEMORYLESS_NODES is enabled, cpu_to_node()/numa_node_id()
> may return a node without memory, and later cause system failure/panic
> when calling kmalloc_node() and friends with returned node id.
> So use cpu_to_mem()/numa_mem_id() instead to get the nearest node with
> memory for the/current cpu.
> 
> If CONFIG_HAVE_MEMORYLESS_NODES is disabled, cpu_to_mem()/numa_mem_id()
> is the same as cpu_to_node()/numa_node_id().
> 
> Signed-off-by: Jiang Liu <jiang.liu@linux•intel.com>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
> index f145adbb55ac..2b74bffa5648 100644
> --- a/drivers/net/ethernet/intel/igb/igb_main.c
> +++ b/drivers/net/ethernet/intel/igb/igb_main.c
> @@ -6518,7 +6518,7 @@ static bool igb_can_reuse_rx_page(struct igb_rx_buffer *rx_buffer,
>  				  unsigned int truesize)
>  {
>  	/* avoid re-using remote pages */
> -	if (unlikely(page_to_nid(page) != numa_node_id()))
> +	if (unlikely(page_to_nid(page) != numa_mem_id()))
>  		return false;
> 
>  #if (PAGE_SIZE < 8192)
> @@ -6588,7 +6588,7 @@ static bool igb_add_rx_frag(struct igb_ring *rx_ring,
>  		memcpy(__skb_put(skb, size), va, ALIGN(size, sizeof(long)));
> 
>  		/* we can reuse buffer as-is, just make sure it is local */
> -		if (likely(page_to_nid(page) == numa_node_id()))
> +		if (likely(page_to_nid(page) == numa_mem_id()))
>  			return true;
> 
>  		/* this page cannot be reused so discard it */

This doesn't seem to have anything to do with crashes or errors?

The original code is checking if the NUMA node of a page is remote to
the NUMA node current is running on. Your change makes it check if the
NUMA node of a page is not equal to the nearest NUMA node with memory.
That's not necessarily local, though, which seems like that is the whole
point. In this case, perhaps the driver author doesn't want to reuse the
memory at all for performance reasons? In any case, I don't think this
patch has appropriate justification.

Thanks,
Nish


------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
E1000-devel mailing list
E1000-devel@lists•sourceforge.net
https://lists.sourceforge.net/lists/listinfo/e1000-devel
To learn more about Intel&#174; Ethernet, visit http://communities.intel.com/community/wired

  reply	other threads:[~2014-07-21 17:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1405064267-11678-1-git-send-email-jiang.liu@linux.intel.com>
2014-07-11  7:37 ` [RFC Patch V1 03/30] mm, net: Use cpu_to_mem()/numa_mem_id() to support memoryless node Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 04/30] mm, netfilter: " Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 10/30] mm, xfrm: " Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 13/30] mm, i40e: " Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 14/30] mm, i40evf: " Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 15/30] mm, igb: " Jiang Liu
2014-07-21 17:42   ` Nishanth Aravamudan [this message]
2014-07-21 19:53     ` Alexander Duyck
2014-07-21 21:09       ` Nishanth Aravamudan
2014-07-23  3:20         ` Jiang Liu
2014-07-11  7:37 ` [RFC Patch V1 16/30] mm, ixgbe: " Jiang Liu

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=20140721174218.GD4156@linux.vnet.ibm.com \
    --to=nacc@linux$(echo .)vnet.ibm.com \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=bruce.w.allan@intel$(echo .)com \
    --cc=e1000-devel@lists$(echo .)sourceforge.net \
    --cc=jesse.brandeburg@intel$(echo .)com \
    --cc=jiang.liu@linux$(echo .)intel.com \
    --cc=john.ronciak@intel$(echo .)com \
    --cc=linux-hotplug@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-mm@kvack$(echo .)org \
    --cc=linux.nics@intel$(echo .)com \
    --cc=mgorman@suse$(echo .)de \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=peterz@infradead$(echo .)org \
    --cc=rafael.j.wysocki@intel$(echo .)com \
    --cc=rientjes@google$(echo .)com \
    --cc=tony.luck@intel$(echo .)com \
    --cc=umgwanakikbuti@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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