Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4137447pxf; Tue, 23 Mar 2021 03:46:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyw1Ms5Bc1g7IxrLwvM5H7YnxTXx6t6auH0NGaNC8d4bvt/kSnfwpf0EB0JRyugg+o8aFMo X-Received: by 2002:a05:6402:4395:: with SMTP id o21mr3924556edc.22.1616496370921; Tue, 23 Mar 2021 03:46:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616496370; cv=none; d=google.com; s=arc-20160816; b=GVE+g1sAS+6wdpzKHZ5/mNtiyJnji+lAmLz7leCkkeNj0or7LPvRa3Gy+7RjJ75iXA meVoE3myvIojFe0eMZVNQjdJMo1s8AulVjJP2Sgeh3nVsuzCGr/Vg12+jEatH3dRLv+h JhziO6Wus0viQz6P469QO5TwqhIkbBbeLW6jFwpK7SYrV8gGQjL2Ucoz2HD594SooGeK U0MRSC/dL7RRohjqaJjDCtY+yO86GZ2GpNAGM+LlJVG+v1N9i9TY6l7ygiqm/BEpuC6w 16zmc4xb+nxTjIpO04JB8Jh8/rpxaoaziiMpKpOg+nXheT7iAVUZBqfskbhHsZ79f1ts qh1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=cDcqash9aWrMBhDFY8nfbKWemveNhoODAauGWDAQ0x0=; b=e9ppFEeec2X3ryEgjpD6DW7xGA4is3dmGxe6bGyo+gWTAPjW5M9HAkYvd5SpJKhjtg 8TQnytCAum9XHyOLtORTA2TS7Nrp7N5Sqm7agBzf3UINV/OaptULLuEjBrmlNleESAyl kVHvmPeNnod5tKmy7l+7rRcm5APJzZXiKlchk5UFfImyYqVWIHc4+Giv/8B1rD0aFAL0 dP9vhxI+6HHoOJwOKKUK13RZDsXWLsQ/rEnBfjlNE6OzTUvms0ze/AmjaPAF9spjXoSz cCdQRhptw5gjSvfaDCrwjGqapZ0PM7AhW4BC/nZJ2c4AI3jb60dAIce129MpKzPYnNso l7gg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i10si13515602edc.63.2021.03.23.03.45.10; Tue, 23 Mar 2021 03:46:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230274AbhCWKof (ORCPT + 99 others); Tue, 23 Mar 2021 06:44:35 -0400 Received: from outbound-smtp07.blacknight.com ([46.22.139.12]:38851 "EHLO outbound-smtp07.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230357AbhCWKo0 (ORCPT ); Tue, 23 Mar 2021 06:44:26 -0400 Received: from mail.blacknight.com (pemlinmail06.blacknight.ie [81.17.255.152]) by outbound-smtp07.blacknight.com (Postfix) with ESMTPS id 9008E1C4157 for ; Tue, 23 Mar 2021 10:44:23 +0000 (GMT) Received: (qmail 30040 invoked from network); 23 Mar 2021 10:44:23 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 23 Mar 2021 10:44:23 -0000 Date: Tue, 23 Mar 2021 10:44:21 +0000 From: Mel Gorman To: Jesper Dangaard Brouer , Chuck Lever Cc: Vlastimil Babka , Andrew Morton , Christoph Hellwig , Alexander Duyck , Matthew Wilcox , LKML , Linux-Net , Linux-MM , Linux-NFS Subject: Re: [PATCH 0/3 v5] Introduce a bulk order-0 page allocator Message-ID: <20210323104421.GK3697@techsingularity.net> References: <20210322091845.16437-1-mgorman@techsingularity.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20210322091845.16437-1-mgorman@techsingularity.net> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Mar 22, 2021 at 09:18:42AM +0000, Mel Gorman wrote: > This series is based on top of Matthew Wilcox's series "Rationalise > __alloc_pages wrapper" and does not apply to 5.12-rc2. If you want to > test and are not using Andrew's tree as a baseline, I suggest using the > following git tree > > git://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git mm-bulk-rebase-v5r9 > Jesper and Chuck, would you mind rebasing on top of the following branch please? git://git.kernel.org/pub/scm/linux/kernel/git/mel/linux.git mm-bulk-rebase-v6r2 The interface is the same so the rebase should be trivial. Jesper, I'm hoping you see no differences in performance but it's best to check. For Chuck, this version will check for holes and scan the remainder of the array to see if nr_pages are allocated before returning. If the holes in the array are always at the start (which it should be for sunrpc) then it should still be a single IRQ disable/enable. Specifically, each contiguous hole in the array will disable/enable IRQs once. I prototyped NFS array support and it had a 100% success rate with no sleeps running dbench over the network with no memory pressure but that's a basic test on a 10G switch. The basic patch I used to convert sunrpc from using lists to an array for testing is as follows; diff --git a/net/sunrpc/svc_xprt.c b/net/sunrpc/svc_xprt.c index 922118968986..0ce33c1742d9 100644 --- a/net/sunrpc/svc_xprt.c +++ b/net/sunrpc/svc_xprt.c @@ -642,12 +642,10 @@ static void svc_check_conn_limits(struct svc_serv *serv) static int svc_alloc_arg(struct svc_rqst *rqstp) { struct svc_serv *serv = rqstp->rq_server; - unsigned long needed; struct xdr_buf *arg; - struct page *page; LIST_HEAD(list); int pages; - int i; + int i = 0; pages = (serv->sv_max_mesg + 2 * PAGE_SIZE) >> PAGE_SHIFT; if (pages > RPCSVC_MAXPAGES) { @@ -657,29 +655,15 @@ static int svc_alloc_arg(struct svc_rqst *rqstp) pages = RPCSVC_MAXPAGES; } - for (needed = 0, i = 0; i < pages ; i++) { - if (!rqstp->rq_pages[i]) - needed++; - } - i = 0; - while (needed) { - needed -= alloc_pages_bulk(GFP_KERNEL, needed, &list); - for (; i < pages; i++) { - if (rqstp->rq_pages[i]) - continue; - page = list_first_entry_or_null(&list, struct page, lru); - if (likely(page)) { - list_del(&page->lru); - rqstp->rq_pages[i] = page; - continue; - } + while (i < pages) { + i = alloc_pages_bulk_array(GFP_KERNEL, pages, &rqstp->rq_pages[0]); + if (i < pages) { set_current_state(TASK_INTERRUPTIBLE); if (signalled() || kthread_should_stop()) { set_current_state(TASK_RUNNING); return -EINTR; } schedule_timeout(msecs_to_jiffies(500)); - break; } } rqstp->rq_page_end = &rqstp->rq_pages[pages]; -- Mel Gorman SUSE Labs