From patchwork Wed Oct 22 23:38:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Toppins X-Patchwork-Id: 402320 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0B853140076 for ; Thu, 23 Oct 2014 10:38:39 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933569AbaJVXie (ORCPT ); Wed, 22 Oct 2014 19:38:34 -0400 Received: from ext3.cumulusnetworks.com ([198.211.106.187]:60229 "EHLO ext3.cumulusnetworks.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932623AbaJVXie convert rfc822-to-8bit (ORCPT ); Wed, 22 Oct 2014 19:38:34 -0400 Received: from localhost (localhost [127.0.0.1]) by ext3.cumulusnetworks.com (Postfix) with ESMTP id 3946B19E2AF6; Wed, 22 Oct 2014 16:38:33 -0700 (PDT) Received: from ext3.cumulusnetworks.com ([127.0.0.1]) by localhost (ext3.cumulusnetworks.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id ko4ajtKjv2Pq; Wed, 22 Oct 2014 16:38:32 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by ext3.cumulusnetworks.com (Postfix) with ESMTP id AFF1119E2C59; Wed, 22 Oct 2014 16:38:32 -0700 (PDT) X-Virus-Scanned: amavisd-new at cumulusnetworks.com Received: from ext3.cumulusnetworks.com ([127.0.0.1]) by localhost (ext3.cumulusnetworks.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id vT7s2GK-QXVw; Wed, 22 Oct 2014 16:38:32 -0700 (PDT) Received: from jtoppins-macbook.local (cpe-173-095-150-122.nc.res.rr.com [173.95.150.122]) by ext3.cumulusnetworks.com (Postfix) with ESMTPSA id 58B9219E2AF6; Wed, 22 Oct 2014 16:38:32 -0700 (PDT) Message-ID: <54483FF7.4090208@cumulusnetworks.com> Date: Wed, 22 Oct 2014 19:38:31 -0400 From: Jonathan Toppins User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Crestez Dan Leonard , netdev@vger.kernel.org Subject: Re: [RFC] tcp md5 use of alloc_percpu References: <5447FDB2.2010906@gmail.com> In-Reply-To: <5447FDB2.2010906@gmail.com> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 10/22/14, 2:55 PM, Crestez Dan Leonard wrote: > sg_init_one does virt_addr on the pointer which assumes it is directly accessible. But the tcp_md5sig_pool pointer comes from alloc_percpu which can return memory from the vmalloc area after the pcpu_first_chunk is exhausted. This looks wrong to me. I'm am getting crashes on mips and I believe this to be the cause. Thinking about this more if the issue really is sg_init_one assumes a directly accessible memory region, can we just modify the zone allocation to GFP_DMA using alloc_percpu_gfp()? Does this satisfy the assumptions made by sg_init_one? --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1bec4e7..6924320 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2889,7 +2889,7 @@ static void __tcp_alloc_md5sig_pool(void) int cpu; struct tcp_md5sig_pool __percpu *pool; - pool = alloc_percpu(struct tcp_md5sig_pool); + pool = alloc_percpu_gfp(struct tcp_md5sig_pool, GFP_DMA); if (!pool) return;