Received: by 10.213.65.68 with SMTP id h4csp2730516imn; Mon, 9 Apr 2018 08:09:30 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+sYUxClfYSMsmjES7vowim0QBKl4VK74xJTg6QR9aVipAjNOJ1gRkK96/Jn1Owuo5mK5F2 X-Received: by 10.101.77.145 with SMTP id p17mr25579727pgq.275.1523286570893; Mon, 09 Apr 2018 08:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523286570; cv=none; d=google.com; s=arc-20160816; b=Sq87nzOpI/PA3iVNZniWKuuhS6YVD2Xm9ejD+9p0bmwvJRNZ4gcPf/Dbhy70VoUpca S+1Yp/Yrs4OYJU6EZrnE5FeSzxVUvvS2/2KHFr09eMRRVl5J45GeVB2hf3c7WaL3Udik INtcceymRIipKTCajNYtVXvU0FyDDTLyz79TpwnYm7DS0oRfg8zQXXVYiliSjSFoE1q/ hP9pPVmuTEaEq5S5B0waRxFnFN6Kl2e+M/s9x4Ny0WwMMjeO9fNCZCcDGGpLJey1kOw3 48YUU+GXdN1mqHBw02W1QLrU7pshSCCf8SvpIxxlvaFZpLo6pjUrB7P7CKroFtZ/QP9K Pm/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0MHfCDeR33w2xt5HIg9PiHknGU61a0eTblmtXOTYqik=; b=gwBCa8gM35485iVo5zZF4kGuGyJQM4aNtsoIxjxB2xZlPv7hlYIBh7bt6orLmVbLOk xqkgAx55JOcSd8P5bxx/AdJBlf2dbry94TBbusWUBxuTAcqSAqxGK55jYGCJoBrlhxS7 EcVjUfMe8z9r1z7t9XHO0a3zuycrCXczetJU3PRk64jqDyeCwEfhv4K/vPO3rxPLEskp OeOHKCk080OY/YSob/GycGZYbkbaJVqvTkpeF++9Cao5l0+BE393eOmrzeZSqmQTh5NZ HkH+j+9fM+dVXTtRcsh5us9dJ8VdLPmBtfair5TAGkqPrwQhRHtytacmTnKJELhUMRgq d7SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f3VruVWT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f8-v6si490798plk.538.2018.04.09.08.08.54; Mon, 09 Apr 2018 08:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=f3VruVWT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753143AbeDIPEa (ORCPT + 99 others); Mon, 9 Apr 2018 11:04:30 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:44976 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753116AbeDIPET (ORCPT ); Mon, 9 Apr 2018 11:04:19 -0400 Received: by mail-pl0-f67.google.com with SMTP id b6-v6so5311869pla.11 for ; Mon, 09 Apr 2018 08:04:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0MHfCDeR33w2xt5HIg9PiHknGU61a0eTblmtXOTYqik=; b=f3VruVWTWvuova5CMpzweKDsPg21B4Jbbhbm2MoTP9rQCXUWMvfURBjeRmtKzVi6Yh Cf2OgwIEh7OGrzl46WJlBOYi0w2qDFVuZufSb/1Vdvhcem+UKq68EF46qWI15tETJW+2 C+AIxPYJlAFWJmXl2sEZ+elnIfvStbFWwdcSgHOOfY+3QqVjwRC+cWMjfLz5MWZbMg1I TI7n1dg0qlTL1ZbioITl3z+GUGWOrHSDleJO5euntanEfqWE8x9HPUOKSmF8yEdlLhm1 0SG6KQVsqo8X7AkRYnJWvFSFS34GGQojkUGc02ra5Ba8QmQZsKD1FjQtqflArocnNU/0 c61A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0MHfCDeR33w2xt5HIg9PiHknGU61a0eTblmtXOTYqik=; b=Diie2VN1V+BIClhYH2dTjTph3HydmgINMPjQCr/VpzB+NWd0/41nK7yibrpGUFMsi4 zHOfRLvN/nX+ivUEzWQu6kyPsgYtO8Z5w0cfzVCpEwkc7AaZxcAnaQkTEWdz/LTc0h/N wy/H5BMNLyB1SyuMS0k09urXAjAEgZu+PVx/U2zBhgjPcxdQe7eBkdhH8yTqa+rMZp23 Rb0cTZ9P9lfXfxpnDfcYBq6SCGG/sLDcXF0cO4b+2q7yM12JHvCkeibSbedbsitWEbbq O4Arpy+xV5sBSCDCNHt23cRxsX35BFpS6G1XWMKSplV1a6trtNphSwGA2A7F/AWRHaMG Uwdw== X-Gm-Message-State: AElRT7H+yL4DlAALHYMxlgLHt2FaFyuF81D3s14NIVG3RCtaVfwfU5rH aIhDDEFuE/XBQYWUqUCseYY= X-Received: by 2002:a17:902:8c8c:: with SMTP id t12-v6mr39207500plo.100.1523286259350; Mon, 09 Apr 2018 08:04:19 -0700 (PDT) Received: from oslab.tsinghua.edu.cn ([2402:f000:1:4413:39e9:70fb:21a6:f4d2]) by smtp.gmail.com with ESMTPSA id i127sm1518144pgc.12.2018.04.09.08.04.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Apr 2018 08:04:18 -0700 (PDT) From: Jia-Ju Bai To: boris.ostrovsky@oracle.com, jgross@suse.com, gregkh@linuxfoundation.org Cc: xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, Jia-Ju Bai Subject: [PATCH 3/4] xen: xen-pciback: Replace GFP_ATOMIC with GFP_KERNEL in pcistub_device_alloc Date: Mon, 9 Apr 2018 23:04:12 +0800 Message-Id: <1523286252-26455-1-git-send-email-baijiaju1990@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org pcistub_device_alloc() is never called in atomic context. The call chain ending up at pcistub_device_alloc() is: [1] pcistub_device_alloc() <- pcistub_seize() <- pcistub_probe() pcistub_probe() is only set as ".probe" in struct pci_driver. This function is not called in atomic context. Despite never getting called from atomic context, pcistub_device_alloc() calls kzalloc() with GFP_ATOMIC, which does not sleep for allocation. GFP_ATOMIC is not necessary and can be replaced with GFP_KERNEL, which can sleep and improve the possibility of sucessful allocation. Signed-off-by: Jia-Ju Bai --- drivers/xen/xen-pciback/pci_stub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 9e480fd..fecc536 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -71,7 +71,7 @@ static struct pcistub_device *pcistub_device_alloc(struct pci_dev *dev) dev_dbg(&dev->dev, "pcistub_device_alloc\n"); - psdev = kzalloc(sizeof(*psdev), GFP_ATOMIC); + psdev = kzalloc(sizeof(*psdev), GFP_KERNEL); if (!psdev) return NULL; -- 1.9.1