Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp23005ybm; Mon, 20 May 2019 11:09:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyio3iTX17hBTULNQxeoluSPzIhzko3/P4pQ7PBmqIRwD67+lrAyzbdLGqD0srLSjN7Ne6K X-Received: by 2002:a17:902:683:: with SMTP id 3mr34021998plh.209.1558375752185; Mon, 20 May 2019 11:09:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558375752; cv=none; d=google.com; s=arc-20160816; b=Ncx8mKdn/wGpM5eHlJlrdg7ST/+Isncl+5Hi7LSoHCLCuXzYZ3x2ve4afWGcVvMcfk bicy45BiTB4SE/sgalORp98q6/k/MBiRkT+kzKF8P5PLxKfCT8b6gWtsz0NAB5UuEoX6 ZQPJNrVV2B48uU18A/F1M4iWXaVTnsqHyO6uJ6LBmMC36ru3gH11USeqK+JLYsm0YBIZ sPiWUYFQUm3NOhsoQJUpDdtwZ17/P7mTshfXLAOLZwcUjWqroegQbUi1XSdMKEvvlnmv HogmXMJ5mw5WZoe2xqpaTHxMKmi37alM8abK93ozgWASxZOE+M3eqQ0z9U1ME7iv1FmZ N2Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=LyCOF91sKOXoKMxXRxwCUpS0O5n3MU0wFcINOXOMfXA=; b=uG3mtiJ2DeY0DcJKq8LaB58j/zT67YajBmpjbC9+zmrXtNxSlaA0FphM8O/4xVVbvZ R227Z0UQPF8ctJ8LzW1yraNaXxjbwdJUGnEaE5SBOp2+ckbnYXhe3jZVw1MVl4C4taxx uLmt3dXCOvJ4qlK4sfi0j24ho0dJLAtAXcjtAaRpQsUzS0HuKxSnVVG/R0hSLHy/pU4t ABk6GqVLff8I9BtqkeiDRFEDGjw0AzQwZ5+68HbEicWqnQIe3SVeKtebk7jAbqKiS1Cw 9D1zEwiCrpsaDgxtrnPo8jzm7VmVJlxxmprIh0In83/E0uAMM8VuecmEfHX+hJ/mXQ7k pCYw== 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 f14si18309482pfd.228.2019.05.20.11.08.57; Mon, 20 May 2019 11:09:12 -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 S1733221AbfETOQ7 (ORCPT + 99 others); Mon, 20 May 2019 10:16:59 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:58742 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1731093AbfETOQ6 (ORCPT ); Mon, 20 May 2019 10:16:58 -0400 Received: (qmail 1756 invoked by uid 2102); 20 May 2019 10:16:57 -0400 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 20 May 2019 10:16:57 -0400 Date: Mon, 20 May 2019 10:16:57 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Christoph Hellwig cc: Oliver Neukum , Jaewon Kim , , , Jaewon Kim , , , , Subject: Re: [RFC PATCH] usb: host: xhci: allow __GFP_FS in dma allocation In-Reply-To: <20190520101206.GA9291@infradead.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 20 May 2019, Christoph Hellwig wrote: > On Mon, May 20, 2019 at 11:09:25AM +0200, Oliver Neukum wrote: > > we actually do. It is just higher up in the calling path: > > Perfect! > > > So, do we need to audit the mem_flags again? > > What are we supposed to use? GFP_KERNEL? > > 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? Alan Stern