Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3832492imm; Mon, 2 Jul 2018 06:25:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKSPLYAfxTUqIl6Wx8JtInjEjrFjbpW7ImgED5Npr9KEK0eDcGh268mh3Gev4oDpChvByop X-Received: by 2002:a65:4249:: with SMTP id d9-v6mr21950145pgq.362.1530537954949; Mon, 02 Jul 2018 06:25:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530537954; cv=none; d=google.com; s=arc-20160816; b=twajOJkSX7ItaEm6AwX0nvBEW2ySXuxEZeKdyvGHgZcW+SuMDFvlFiYjhnyO02fB3T PdOyfXR+lYmgy6DCTod5J5oMowxGRiGzo2QOsiOC8USq1ENzNr196FyoetPZJxSnY7GH 0naVD7SkM26NYGzFIQZQ+SdwF7pJHZWqISbMqbMDy4mc/+6CR6HTcyeD11KZXIDepLt4 pXrHg509cGG3PRn78jtefdyFnD8zpfl7PkCccrL22/ehi+WrB9MHl9hdkQiT3dlRO+n7 h4riFTXn0tz/hohn/DQXQHRG2knYjkRn3dw5OL07zgoCyCZTDWgmAkT3l6P1JTOjWQTK 7QTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:message-id :content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter :arc-authentication-results; bh=K2dRMZ3IqQg7dzggnUw6GdH7UVDwpLaVRNUF0FK5QA0=; b=NBNCQKI/7yJV0Z7QOZjq+4NFkcv+tfbhQUAW9SyukETnb4Y05eHrOrGzoAitDcGncr I0uIS5zcvepPGZt2fq3xXDTTyJ3EgbY528o4It/GDvE+kJhY7WvQYvdnbKUjyErJJt7L W184+SwkZux/m5uaJyOPrP7BQodzpg0ZjxKKIqDXmtETDZ8q2gmMtN1T5SxBhajpJ8M0 QmUNAmSU2jKQJZpZXWkaphhw0JdYWnY/z9kwu+kZrZGgsIHGwYVvL6T5jtbvmXIYcZPw 04UwSAwTusnpF6E1Rvopsd1iVWu+3c8R8MCXOuBrBEVcZYG+UH6ZdaaNgudgT2sffN2i 0koQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=d+eWUAjH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x18-v6si15562028pln.147.2018.07.02.06.25.35; Mon, 02 Jul 2018 06:25:54 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=d+eWUAjH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752416AbeGBNXl (ORCPT + 99 others); Mon, 2 Jul 2018 09:23:41 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:50544 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752150AbeGBNXj (ORCPT ); Mon, 2 Jul 2018 09:23:39 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20180702132337euoutp02592d17633106be36acede6b5207aafa4~9kAlFZOof1870518705euoutp02b for ; Mon, 2 Jul 2018 13:23:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20180702132337euoutp02592d17633106be36acede6b5207aafa4~9kAlFZOof1870518705euoutp02b DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1530537817; bh=K2dRMZ3IqQg7dzggnUw6GdH7UVDwpLaVRNUF0FK5QA0=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=d+eWUAjHF69Kd9fQaoh2EHzZ8ARUeVoTLAMNvGv6b1ZuFhZTZ9gDuZhFoRVHZvZ/y smbUb7A9MVStMHab6qtTKcsLXBpQaKmZogJmYvnvGWt5rDQnppU6JAr2g1rYTh/OTA nFDVaRqqf1kwDBoNsYsvk3J+1uFwbH7gO75ByeAQ= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20180702132336eucas1p1969f2938694744450568b4f0f2f194f5~9kAj4F2cx2829228292eucas1p1V; Mon, 2 Jul 2018 13:23:36 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 94.1F.17380.8572A3B5; Mon, 2 Jul 2018 14:23:36 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20180702132335eucas1p1323fbf51cd5e82a59939d72097acee04~9kAizDyji0466904669eucas1p1w; Mon, 2 Jul 2018 13:23:35 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20180702132335eusmtrp2af4e0f56699029742c0d84475aa37708~9kAiixB_c1766317663eusmtrp2E; Mon, 2 Jul 2018 13:23:35 +0000 (GMT) X-AuditID: cbfec7f4-6f9ff700000043e4-2b-5b3a2758eec7 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 2B.12.04183.7572A3B5; Mon, 2 Jul 2018 14:23:35 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20180702132334eusmtip276dcc3d3962394f03ccc23dfc1b8658e~9kAiGHk_V1508215082eusmtip2I; Mon, 2 Jul 2018 13:23:34 +0000 (GMT) Subject: Re: [PATCH] mm: cma: honor __GFP_ZERO flag in cma_alloc() To: Michal Hocko , Christoph Hellwig Cc: Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Andrew Morton , Michal Nazarewicz , Joonsoo Kim , Vlastimil Babka From: Marek Szyprowski Date: Mon, 2 Jul 2018 15:23:34 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180613133913.GD20315@dhcp22.suse.cz> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDKsWRmVeSWpSXmKPExsWy7djPc7oR6lbRBjt28FnMWb+GzeL0hEVM Fiu7m9ksNj2+xmpxedccNot7a/6zWrz+tozZYsHxFlaL2Y19jBa/f8xhc+Dy2LxCy2PTqk42 j02fJrF7dL29wuRxYsZvFo/NS+o91v15xeRxZsERdo/Pm+QCOKO4bFJSczLLUov07RK4Mha9 us5ScJCr4t7OPywNjHs5uhg5OSQETCQOzv7N0sXIxSEksIJRYv36B0wgCSGBL4wSu97IQiQ+ M0p82nCdDaZj15wOVojEckaJnq4fUM57RonVHY+ZQaqEBZwk9h9bxgpiiwh4S3Q+3Aa2g1lg AZNE36MpYKPYBAwlut52AdkcHCwCKhIdy4xBwqICMRLbLj9gAbF5BQQlTs58AmZzAm2+/+ch 2HnMAvIS29/OYYawxSVuPZnPBDJfQuARu0Tf4qNsEM1lEpNaf0Gd7SKxs+06K4QtLPHq+BZ2 CFtG4v9OmOZmRon2GbPYIZweRomtc3ZAdVtLHD5+kRXkUmYBTYn1u/Qhwo4SLadugj0gIc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y44tK c1KLDzGaAv02kVlKNDkfmFLySuINTQ3NLSwNzY3Njc0slMR5zxtURgkJpCeWpGanphakFsH0 MXFwSjUwBpy8/7S5jedhqRlDgm7vD+Msbg7u4zcOBzy5XSnOKfR0yvofE+p76muXHH12Zh7/ musLehqq+OP8XL7Krfwz11WusuzLVg9flVy27fkLyyd/Wli+b/eSBDe+1be3cwQu+/E4R/+h 4t+zm3JYdpZ+vmHxX1PEaeeufHuhhU4OffPj0nvnzP+kqcRSnJFoqMVcVJwIAGmkLPrxAgAA Message-Id: <20180702132335eucas1p1323fbf51cd5e82a59939d72097acee04~9kAizDyji0466904669eucas1p1w@eucas1p1.samsung.com> X-CMS-MailID: 20180702132335eucas1p1323fbf51cd5e82a59939d72097acee04 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20180613085851eucas1p20337d050face8ff8ea87674e16a9ccd2 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20180613085851eucas1p20337d050face8ff8ea87674e16a9ccd2 References: <20180613085851eucas1p20337d050face8ff8ea87674e16a9ccd2~3rI_9nj8b0455904559eucas1p2C@eucas1p2.samsung.com> <20180613122359.GA8695@bombadil.infradead.org> <20180613124001eucas1p2422f7916367ce19fecd40d6131990383~3uKFrT3ML1977219772eucas1p2G@eucas1p2.samsung.com> <20180613125546.GB32016@infradead.org> <20180613133913.GD20315@dhcp22.suse.cz> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On 2018-06-13 15:39, Michal Hocko wrote: > On Wed 13-06-18 05:55:46, Christoph Hellwig wrote: >> On Wed, Jun 13, 2018 at 02:40:00PM +0200, Marek Szyprowski wrote: >>> It is not only the matter of the spinlocks. GFP_ATOMIC is not supported >>> by the >>> memory compaction code, which is used in alloc_contig_range(). Right, this >>> should be also noted in the documentation. >> Documentation is good, asserts are better. The code should reject any >> flag not explicitly supported, or even better have its own flags type >> with the few actually supported flags. > Agreed. Is the cma allocator used for anything other than GFP_KERNEL > btw.? If not then, shouldn't we simply drop the gfp argument altogether > rather than give users a false hope for differen gfp modes that are not > really supported and grow broken code? Nope, all cma_alloc() callers are expected to use it with GFP_KERNEL gfp mask. The only flag which is now checked is __GFP_NOWARN. I can change the function signature of cma_alloc to: struct page *cma_alloc(struct cma *cma, size_t count, unsigned int align, bool no_warn); What about clearing the allocated buffer? Should it be another bool parameter, done unconditionally or moved to the callers? Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland