Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp708676ybt; Fri, 26 Jun 2020 09:37:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDRfne63S7SLxWhcTwaIhqAo+gnfKAZIsT2bhp3Z+CPlJkJ+l0c4pmbAYrRDlFBfmTJspb X-Received: by 2002:a17:906:8381:: with SMTP id p1mr3276750ejx.280.1593189469490; Fri, 26 Jun 2020 09:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593189469; cv=none; d=google.com; s=arc-20160816; b=dYol+muBuzD01zo0t5CnbVEVhA9CeCGHhBLTt5ljPZ8KRgk78Y5rs1Tv6dp5VMRKL+ cYh9d/Zsr8YpClsexK31O7zedxtDricKjbKakCKuIAYz/ooy5Q1LB3/JFIPa7KgVYhWE K5TbEK1pIopl1poC7voi3E831ChqzKIp63hUwq71ltIH4ZIS1M4GcgsK4CwCiHQGMUkq RaVU2Vh3EbezijYLTCLRA7UvNDCaGY7O93lbK5XpA6E8M5GoYRQxnZYw/0kqdUAY9QD4 +gBcKW/dzNKEwYOr+MALoa1G7Awnxbq/OjZj8DuYiRxZTzappqcix6lp/sX/oMhjJ9i1 JO2Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=fHKbqpiGBYPXJ+14sGPnxiW9V8XsYSBUqlw0hE9Dm9c=; b=mQUFRV2414PmGgMavUAt2l8JuoZkcwtsQq7PnGn5MyjL/qU85tqMmoRzrIYVSC3l8I X7iOErJPCVoaS+tOyWTavNc/rWqkfHl0QGGA90NYkKEGc23mw//dDsDpjMOKfzhaNU5d RFl9VfZSnSh8rldKv+ZN1FFGGcrLRqeb84NBmuJH1tVOqNym0CjyPCpEqImq0ElVGBDa q9N3ltQLJN1nJluaoKzG5oDGK+ISkMfnH9zTvAiFIIo0x5R5kg4IXeLSEF+I34J6QeCo /lputdsWjoK+mcBQCwjkVcyOJxoXD+pKKE93fxZbUiZg64SR/5HRGmDzyOYc+NjwXIQ1 JPQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QFH5H3jk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y18si9463827edw.583.2020.06.26.09.37.26; Fri, 26 Jun 2020 09:37:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=QFH5H3jk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgFZPCs (ORCPT + 99 others); Fri, 26 Jun 2020 11:02:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:30117 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725836AbgFZPCs (ORCPT ); Fri, 26 Jun 2020 11:02:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1593183767; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fHKbqpiGBYPXJ+14sGPnxiW9V8XsYSBUqlw0hE9Dm9c=; b=QFH5H3jkeT/0JieVJ7o/qMCm4Wy7hkfzA4lTQeegR9z/sZ6u04MvDo4kGbPNe1c61PWmpQ zUwFfdho4tA65KAL8SzI6Si03lky5QaXv7ZytHQ0KYvOK+LY/ZJKPvU2bqvIZyihYrd8np TMy/2B1WJOJTBkExGZVOFulZsuOHIp4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-474-6Os_ZGzQM0a4ZkBmt1xVMw-1; Fri, 26 Jun 2020 11:02:27 -0400 X-MC-Unique: 6Os_ZGzQM0a4ZkBmt1xVMw-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 3E290464; Fri, 26 Jun 2020 15:02:26 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (file01.intranet.prod.int.rdu2.redhat.com [10.11.5.7]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 99A9A60F8A; Fri, 26 Jun 2020 15:02:22 +0000 (UTC) Received: from file01.intranet.prod.int.rdu2.redhat.com (localhost [127.0.0.1]) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4) with ESMTP id 05QF2MDr012492; Fri, 26 Jun 2020 11:02:22 -0400 Received: from localhost (mpatocka@localhost) by file01.intranet.prod.int.rdu2.redhat.com (8.14.4/8.14.4/Submit) with ESMTP id 05QF2J5i012464; Fri, 26 Jun 2020 11:02:21 -0400 X-Authentication-Warning: file01.intranet.prod.int.rdu2.redhat.com: mpatocka owned process doing -bs Date: Fri, 26 Jun 2020 11:02:19 -0400 (EDT) From: Mikulas Patocka X-X-Sender: mpatocka@file01.intranet.prod.int.rdu2.redhat.com To: "Matthew Wilcox (Oracle)" cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-xfs@vger.kernel.org, dm-devel@redhat.com, Jens Axboe , NeilBrown Subject: Re: [PATCH 0/6] Overhaul memalloc_no* In-Reply-To: <20200625113122.7540-1-willy@infradead.org> Message-ID: References: <20200625113122.7540-1-willy@infradead.org> User-Agent: Alpine 2.02 (LRH 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi I suggest to join memalloc_noio and memalloc_nofs into just one flag that prevents both filesystem recursion and i/o recursion. Note that any I/O can recurse into a filesystem via the loop device, thus it doesn't make much sense to have a context where PF_MEMALLOC_NOFS is set and PF_MEMALLOC_NOIO is not set. Mikulas On Thu, 25 Jun 2020, Matthew Wilcox (Oracle) wrote: > I want a memalloc_nowait like we have memalloc_noio and memalloc_nofs > for an upcoming patch series, and Jens also wants it for non-blocking > io_uring. It turns out we already have dm-bufio which could benefit > from memalloc_nowait, so it may as well go into the tree now. > > The biggest problem is that we're basically out of PF_ flags, so we need > to find somewhere else to store the PF_MEMALLOC_NOWAIT flag. It turns > out the PF_ flags are really supposed to be used for flags which are > accessed from other tasks, and the MEMALLOC flags are only going to > be used by this task. So shuffling everything around frees up some PF > flags and generally makes the world a better place. > > Patch series also available from > http://git.infradead.org/users/willy/linux.git/shortlog/refs/heads/memalloc > > Matthew Wilcox (Oracle) (6): > mm: Replace PF_MEMALLOC_NOIO with memalloc_noio > mm: Add become_kswapd and restore_kswapd > xfs: Convert to memalloc_nofs_save > mm: Replace PF_MEMALLOC_NOFS with memalloc_nofs > mm: Replace PF_MEMALLOC_NOIO with memalloc_nocma > mm: Add memalloc_nowait > > drivers/block/loop.c | 3 +- > drivers/md/dm-bufio.c | 30 ++++-------- > drivers/md/dm-zoned-metadata.c | 5 +- > fs/iomap/buffered-io.c | 2 +- > fs/xfs/kmem.c | 2 +- > fs/xfs/libxfs/xfs_btree.c | 14 +++--- > fs/xfs/xfs_aops.c | 4 +- > fs/xfs/xfs_buf.c | 2 +- > fs/xfs/xfs_linux.h | 6 --- > fs/xfs/xfs_trans.c | 14 +++--- > fs/xfs/xfs_trans.h | 2 +- > include/linux/sched.h | 7 +-- > include/linux/sched/mm.h | 84 ++++++++++++++++++++++++++-------- > kernel/sys.c | 8 ++-- > mm/vmscan.c | 16 +------ > 15 files changed, 105 insertions(+), 94 deletions(-) > > -- > 2.27.0 >