From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755668AbbIALjo (ORCPT ); Tue, 1 Sep 2015 07:39:44 -0400 Received: from casper.infradead.org ([85.118.1.10]:45655 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752309AbbIALjn (ORCPT ); Tue, 1 Sep 2015 07:39:43 -0400 Date: Tue, 1 Sep 2015 13:39:39 +0200 From: Peter Zijlstra To: Ingo Molnar Cc: Taku Izumi , linux-kernel@vger.kernel.org, mingo@redhat.com, acme@kernel.org, hpa@zytor.com, x86@kernel.org, jolsa@redhat.com Subject: Re: [PATCH v2][RESEND] perf, x86: Fix multi-segment problem of perf_event_intel_uncore Message-ID: <20150901113939.GS19282@twins.programming.kicks-ass.net> References: <1440672872-129663-1-git-send-email-izumi.taku@jp.fujitsu.com> <20150901111533.GQ19282@twins.programming.kicks-ass.net> <20150901113147.GA11161@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150901113147.GA11161@gmail.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 01, 2015 at 01:31:47PM +0200, Ingo Molnar wrote: > > * Peter Zijlstra wrote: > > > +struct __find_pci2phy(int segment) > > +{ > > + struct pci2phy_map *map; > > + > > + lockdep_assert_held(&pci2phy_map_lock); > > + > > + list_for_each_entry(map, &pci2phy_map_head, list) { > > + if (map->segment == segment) > > + return map; > > + } > > + > > + map = kmalloc(sizeof(struct pci2phy_map), GFP_ATOMIC); > > I really don't think we should be adding new GFP_ATOMIC allocations whenever it > can be avoided. I tend to agree, it makes the whole thing rather fragile...