From patchwork Mon Dec 13 12:27:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 12673831 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 56FE3C433F5 for ; Mon, 13 Dec 2021 12:28:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id AA5CD6B0071; Mon, 13 Dec 2021 07:27:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id A55B66B0073; Mon, 13 Dec 2021 07:27:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9463C6B0074; Mon, 13 Dec 2021 07:27:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0051.hostedemail.com [216.40.44.51]) by kanga.kvack.org (Postfix) with ESMTP id 8604C6B0071 for ; Mon, 13 Dec 2021 07:27:49 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 40F4F8249980 for ; Mon, 13 Dec 2021 12:27:39 +0000 (UTC) X-FDA: 78912697038.10.0E6BD23 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf30.hostedemail.com (Postfix) with ESMTP id CC3A18000F for ; Mon, 13 Dec 2021 12:27:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1639398458; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=AXDQj/M+Kv+QlgV1YzJntHLLjz9azaZev3PPgfKBnRw=; b=FQLuwloUcOHl7JLuqn3Cl5vDjB+Q3/0WpYis46DU2rfL5qx7wjdsuL4greVoR8DCHYXn42 012TapkWGm9yJZ7UgLtay0zDQSMP/rU1dhvTTNltwkK3Vi1Z1RC6DqU+D9MsLrS6oY50LS piGTDoEzD5uZO7fOwoRPdZcVRv8Nknc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-491-OmAssip9NgygODina39F0A-1; Mon, 13 Dec 2021 07:27:37 -0500 X-MC-Unique: OmAssip9NgygODina39F0A-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4E08810144E1; Mon, 13 Dec 2021 12:27:35 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-202.pek2.redhat.com [10.72.12.202]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA6F177F29; Mon, 13 Dec 2021 12:27:16 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, hch@lst.de, cl@linux.com, John.p.donnelly@oracle.com, kexec@lists.infradead.org, bhe@redhat.com Subject: [PATCH v3 0/5] Avoid requesting page from DMA zone when no managed pages Date: Mon, 13 Dec 2021 20:27:07 +0800 Message-Id: <20211213122712.23805-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Stat-Signature: pxbksfywjrg73b9xmgiah76dqsif3chy Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=FQLuwloU; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf30.hostedemail.com: domain of bhe@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=bhe@redhat.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: CC3A18000F X-HE-Tag: 1639398458-575519 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Background information can be checked in cover letter of v2 RESEND POST as below: https://lore.kernel.org/all/20211207030750.30824-1-bhe@redhat.com/T/#u Changelog: v2-Resend -> v3: - Re-implement has_managed_dma() according to David's suggestion. - Add Fixes tag and cc stable. v2->v2 RESEND: - John pinged to push the repost of this patchset. So fix one typo of suject of patch 3/5; Fix a building error caused by mix declaration in patch 5/5. Both of them are found by John from his testing. - Rewrite cover letter to add more information. v1->v2: Change to check if managed DMA zone exists. If DMA zone has managed pages, go further to request page from DMA zone to initialize. Otherwise, just skip to initialize stuffs which need pages from DMA zone. V2 RESEND post: https://lore.kernel.org/all/20211207030750.30824-1-bhe@redhat.com/T/#u v2 post: https://lore.kernel.org/all/20210810094835.13402-1-bhe@redhat.com/T/#u v1 post: https://lore.kernel.org/all/20210624052010.5676-1-bhe@redhat.com/T/#u Baoquan He (5): docs: kernel-parameters: Update to reflect the current default size of atomic pool dma-pool: allow user to disable atomic pool mm_zone: add function to check if managed dma zone exists dma/pool: create dma atomic pool only if dma zone has managed pages mm/slub: do not create dma-kmalloc if no managed pages in DMA zone Documentation/admin-guide/kernel-parameters.txt | 5 ++++- include/linux/mmzone.h | 9 +++++++++ kernel/dma/pool.c | 11 +++++++---- mm/page_alloc.c | 15 +++++++++++++++ mm/slab_common.c | 9 +++++++++ 5 files changed, 44 insertions(+), 5 deletions(-)