Messages in this thread | | | From | Shameerali Kolothum Thodi <> | Subject | RE: [PATCH v3] irqchip: gicv3-its: Use NUMA aware memory allocation for ITS tables | Date | Fri, 11 Jan 2019 10:34:44 +0000 |
| |
Hi Suzuki,
> -----Original Message----- > From: Suzuki K Poulose [mailto:suzuki.poulose@arm.com] > Sent: 11 January 2019 09:42 > To: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>; > marc.zyngier@arm.com; linux-kernel@vger.kernel.org > Cc: shankerd@codeaurora.org; ganapatrao.kulkarni@cavium.com; > Robert.Richter@cavium.com; Guohanjun (Hanjun Guo) > <guohanjun@huawei.com>; John Garry <john.garry@huawei.com>; > linux-arm-kernel@lists.infradead.org; Linuxarm <linuxarm@huawei.com> > Subject: Re: [PATCH v3] irqchip: gicv3-its: Use NUMA aware memory allocation > for ITS tables >
[...]
> > drivers/irqchip/irq-gic-v3-its.c | 20 ++++++++++++-------- > > 1 file changed, 12 insertions(+), 8 deletions(-) > > > > diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c > > index db20e99..ab01061 100644 > > --- a/drivers/irqchip/irq-gic-v3-its.c > > +++ b/drivers/irqchip/irq-gic-v3-its.c > > @@ -1749,7 +1749,8 @@ static int its_setup_baser(struct its_node *its, > struct its_baser *baser, > > order = get_order(GITS_BASER_PAGES_MAX * psz); > > } > > > > - base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, order); > > + base = (void *)page_address(alloc_pages_node(its->numa_node, > > + GFP_KERNEL | __GFP_ZERO, order)); > > If alloc_pages_node() fails, the page_address() could crash the system. > > > - its->cmd_base = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, > > - get_order(ITS_CMD_QUEUE_SZ)); > > + its->cmd_base = (void > *)page_address(alloc_pages_node(its->numa_node, > > + GFP_KERNEL | __GFP_ZERO, > > + get_order(ITS_CMD_QUEUE_SZ))); > > Similarly here. We may want to handle it properly.
Ah..good catch. I will change it and rebase on top of 5.0-rc1 as suggested by Marc.
Thanks, Shameer
| |