Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp950366ybm; Tue, 21 May 2019 06:26:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqybO/PyAxDWyi3S2Fb4FhRGGgxLCt6Jaw4y5S/8ZD4jWC/rkk1U91N5YzxQQioiD8qBuSiO X-Received: by 2002:a17:902:3103:: with SMTP id w3mr7781968plb.187.1558445167993; Tue, 21 May 2019 06:26:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558445167; cv=none; d=google.com; s=arc-20160816; b=VznH/5pWXeE8HwRD3BmiqGTP+h10/HLsD5+AgNPA9QUbcyW8Tiq0hSp+0xwNPjrTop eH+LWaVqM3PxSG7xC3E7IfoFOIvkLo4OoOGssZZC0ZHzmO0WXpGzqP6+d/mPaN0bVu9n 19C9/7tpKuFQLb1OIvpxXD8qj4pVrQ4wUfHNKLJjP78pHSkjJux7NL64q3/cR8/tHI+n jjMN4vfjc3jvbGPjAunjNfLNPTwohiICQTdJvt7x9M0rrPdF7VS+YtA7IuGUrzXzsQjr XZBkh4CT8vf57iQ37z/DFcus4CCRWYrE1aTlUQtbPm+stLrckQ4uIHiy3P+WmOe8jxRp 8b5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=ejscCpBqbOLVOlM5y870lFaJVE4bE9aesagyHKMmUg0=; b=JSyYLUTl6xKx7oOJ8l5tsFL6dSAP5uTDv9gc2nq/t2lsLoPSVGj8mQwZAocnUJDw3Y gFh6FHM/COiWANkkCjgvDnc05nlWYQT6Ge4ehDM4N33CqSNzOBwmgXNCo8iABm70uOPW ikysi0OWhiZnLV5pgYudI0r8GrhpdY2y7F7JLYOFnxKVUMN+bvLTUU6WkL/iiz+3VxTs MnzI1lip2rPBEH7PppJdIwPfAJRBL8MUauo7zwydkh0ER9KEZEtppdICH1ymlRVTqjeK WReItOMY8x8Xn5Ks150VhLm5HQG10d73rI2CDXqupe+s2UY3hxJqAgBRPc2GkDLGvShk DZ6w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 76si21205661pgf.582.2019.05.21.06.25.51; Tue, 21 May 2019 06:26:07 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728273AbfEUNYb (ORCPT + 99 others); Tue, 21 May 2019 09:24:31 -0400 Received: from mx2.suse.de ([195.135.220.15]:39896 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727044AbfEUNYb (ORCPT ); Tue, 21 May 2019 09:24:31 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 3EA72ADCB; Tue, 21 May 2019 13:24:30 +0000 (UTC) Message-ID: <1558444291.12672.23.camel@suse.com> Subject: Re: [RFC PATCH] usb: host: xhci: allow __GFP_FS in dma allocation From: Oliver Neukum To: Alan Stern , Christoph Hellwig Cc: Jaewon Kim , linux-mm@kvack.org, gregkh@linuxfoundation.org, Jaewon Kim , m.szyprowski@samsung.com, ytk.lee@samsung.com, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Date: Tue, 21 May 2019 15:11:31 +0200 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mo, 2019-05-20 at 10:16 -0400, Alan Stern wrote: > On Mon, 20 May 2019, Christoph Hellwig wrote: > > > GFP_KERNEL if you can block, GFP_ATOMIC if you can't for a good reason, > > that is the allocation is from irq context or under a spinlock. If you > > think you have a case where you think you don't want to block, but it > > is not because of the above reasons we need to have a chat about the > > details. > > What if the allocation requires the kernel to swap some old pages out > to the backing store, but the backing store is on the device that the > driver is managing? The swap can't take place until the current I/O > operation is complete (assuming the driver can handle only one I/O > operation at a time), and the current operation can't complete until > the old pages are swapped out. Result: deadlock. > > Isn't that the whole reason for using GFP_NOIO in the first place? Hi, lookig at this it seems to me that we are in danger of a deadlock - during reset - devices cannot do IO while being reset covered by the USB layer in usb_reset_device - resume & restore - devices cannot do IO while suspended covered by driver core in rpm_callback - disconnect - a disconnected device cannot do IO is this a theoretical case or should I do something to the driver core? How about changing configurations on USB? Regards Oliver