Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp711312ybm; Tue, 21 May 2019 02:08:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/3xPebJjXlr9ONlW9ql4kVewKFOiFYSJFwXjZrSkHAt1K2EGNoiDLeL7xKAheFQ5XSyV8 X-Received: by 2002:a17:902:aa97:: with SMTP id d23mr81474118plr.313.1558429736241; Tue, 21 May 2019 02:08:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558429736; cv=none; d=google.com; s=arc-20160816; b=Rmc6ccm/8deP9rG+cGtnIN5EIGKMuFjfiGBjLQ1i7Xn/8YnEEu1uWoBw18PtY/JmV6 ZRnTS2KWQGbLh4TNCFIQCEAR7Bmv86uXIvT7FHqLMtq6HbKwsCILdzGOn6ATNinkyQ8u +YbxMvuAhZ2TwjVe5R/14rqmNPTWQNmFUFyB0IRYlCCPMSRsiPIJEQo4sYfNX9SHjJmw OEr4LFF3awVnMW+MjMwEAyoYW6+7YCh6ogizE+ww/lIUAB7z6BK0YjO8Sq2aIlxpcFIP TQfH2RkvUuu7ew4W3dFSq+d5wHFVD8b0S9D4AvX7wyN/ZN8iAQecWLWHp0IWfCbofziK xrYQ== 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=iFTUHFmgtiGzvN19St5ee/oHBMyKgoEoF5VVcqVSvpE=; b=mH0e4PVLSOj3VoT+kJTwWXBouqzru87GprvgH95fK0osonIaCihRHeaY713Ix7xPvJ 0VGoidDvoL3xcaM3cifxbbxRRm3b2yya8ElThIZIIdt9ggrjCe8zCqeAsa1zq6TMruy3 egP9OhL0wsu6NMKzrjV/9t/uAbNyVgv4+QUvmIcfLRtr7OWZ8QQlYKSqOHR9P6A4Eknq df8AkxatVtB3ZWWs8jKif0ugYDWqhYId1oq/eyGyPE2TDKzwAJCThrQUWGrAPrEmopyl p7WdWJWb2EHOMRV4H07a2O503RkbFn+MIUTwnxyGB0PKrNbHbbynRvA2sOnnhl/7HPKQ uFQg== 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 w191si22619086pfd.31.2019.05.21.02.08.40; Tue, 21 May 2019 02:08:56 -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 S1726766AbfEUJHg (ORCPT + 99 others); Tue, 21 May 2019 05:07:36 -0400 Received: from mx2.suse.de ([195.135.220.15]:46038 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726391AbfEUJHg (ORCPT ); Tue, 21 May 2019 05:07:36 -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 42ADAAD43; Tue, 21 May 2019 09:07:35 +0000 (UTC) Message-ID: <1558428877.12672.8.camel@suse.com> Subject: Re: [RFC PATCH] usb: host: xhci: allow __GFP_FS in dma allocation From: Oliver Neukum To: Christoph Hellwig , Alan Stern 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 10:54:37 +0200 In-Reply-To: <20190520142331.GA12108@infradead.org> References: <20190520101206.GA9291@infradead.org> <20190520142331.GA12108@infradead.org> 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 07:23 -0700, Christoph Hellwig wrote: > On Mon, May 20, 2019 at 10:16:57AM -0400, Alan Stern wrote: > > 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? > > It is, or rather was. As it has been incredibly painful to wire > up the gfp_t argument through some callstacks, most notably the > vmalloc allocator which is used by a lot of the DMA allocators on > non-coherent platforms, we now have the memalloc_noio_save and > memalloc_nofs_save functions that mark a thread as not beeing to > go into I/O / FS reclaim. So even if you use GFP_KERNEL you will > not dip into reclaim with those flags set on the thread. OK, but this leaves a question open. Will the GFP_NOIO actually hurt, if it is used after memalloc_noio_save()? Regards Oliver