Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp831700rwl; Wed, 12 Apr 2023 04:54:07 -0700 (PDT) X-Google-Smtp-Source: AKy350aY6m4mxcbscsieP5cNNqQj2LVwVrg+gKAICxxAguQues4NLZ+ikz0DkgCQrZbeZSqb3aNh X-Received: by 2002:a05:6402:4f:b0:504:aeb0:3315 with SMTP id f15-20020a056402004f00b00504aeb03315mr7027616edu.7.1681300447237; Wed, 12 Apr 2023 04:54:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681300447; cv=none; d=google.com; s=arc-20160816; b=NPAbvARdIDm7j9DzbPzPngwOFMxzCRrGRdXhXZvD2BkjFZJLtjwSFSgd62wdrs78TE bcbrZCchX8XTMJx77HameA648kOiL0Z30xE1gm317zCMgblhKfavHU5wcaWEkoSYnEtI /Rd8tolkCwgVsRR4Lzlj0w6Jb1MgnLfd36y1mWR6fSv51JJ11NTpCVPMQ8wB7RBKdc+P 3KlkJfXQVBfo2kXILh75uakzNjszhI/8k2Q+QIEl32jPzcbNSZTUjKwZHuMkw80ChgVV 7baAYe7A7o7KlCL6BbheNH0Gwf1IYG8NGIFhlPKbZimx3z5y5H04JR8KeTzfTADxYJv8 QN0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=1Ja8WfyqHG8SWsn6zQcE3DA6xHw8zgmqdkFLfVd1nao=; b=E7naB0PPpXmfv4dF9Ix6MYA9gjDnRVVYTsYgSxidkrh7wbgIPBSTfOhKjceuL/3wyO d6OwoRZE+4EC+HRJO4ivuSms/5WbTDT9m2kmAsnpu552Hx0gvT9HHBuNllSLtUhhff8X HadpqtLjFwwdruMnxLLveMPh5VJ9zjNvChv1a1XvE2iZWYqYMH24mzY2DmZNXOsz1ppX iBPvw+gJ/DAqrHudyIVLnt2uMHYpnIjn2jetl0Acww83gD1+uDUZ7OdF6GUyowGl2WTw grJQVfpt8ZbNEMaUpabNHg5xOIaryBcyL6fsb0o+f0uXg2ipNKeMGrvvfen67HSH1tiO gNhg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tj9RiEfF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u12-20020a05640207cc00b00504a9eca82bsi5411265edy.222.2023.04.12.04.53.42; Wed, 12 Apr 2023 04:54:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=tj9RiEfF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229995AbjDLLvX (ORCPT + 99 others); Wed, 12 Apr 2023 07:51:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229876AbjDLLvP (ORCPT ); Wed, 12 Apr 2023 07:51:15 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 632DB185 for ; Wed, 12 Apr 2023 04:51:14 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 2090C1F890; Wed, 12 Apr 2023 11:51:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1681300273; h=from:from:reply-to: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=1Ja8WfyqHG8SWsn6zQcE3DA6xHw8zgmqdkFLfVd1nao=; b=tj9RiEfFRgbjaA9JmzsqO4x/V60MF6VLKzGIqS6XajSnbTsXJ7c2z4Pk0jpEXOl0YnupOS nq7LTOrycoLteJejYRhoTbuGnpE0IluZkIG6IV9JG/OWBOCC7JbMoK/QRVcLLn6lO1HoAI 4s21ECcJc0DO47X+sQklSGnIwO1o/BE= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id F27FC13498; Wed, 12 Apr 2023 11:51:12 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id /I5NODCbNmQ8QwAAMHmgww (envelope-from ); Wed, 12 Apr 2023 11:51:12 +0000 Date: Wed, 12 Apr 2023 13:51:12 +0200 From: Michal Hocko To: Jaewon Kim Cc: "jstultz@google.com" , "tjmercier@google.com" , "sumit.semwal@linaro.org" , "daniel.vetter@ffwll.ch" , "akpm@linux-foundation.org" , "hannes@cmpxchg.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "jaewon31.kim@gmail.com" Subject: Re: [PATCH v3] dma-buf/heaps: system_heap: avoid too much allocation Message-ID: References: <20230410073228.23043-1-jaewon31.kim@samsung.com> <20230412085726epcms1p7d2bec2526e47bd10a3b6ea6a113c9cc3@epcms1p7> <20230412094440epcms1p445319579ead0d0576bb616ebb07501b4@epcms1p4> <20230412113759epcms1p8cb15b54e3a96c7616419cb030d16f804@epcms1p8> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230412113759epcms1p8cb15b54e3a96c7616419cb030d16f804@epcms1p8> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 12-04-23 20:37:59, Jaewon Kim wrote: > Limiting dmabuf memory may be required. But I think there > is no nice and reasonable way so far. If that is really the way then the patch doesn't really add a big benefit. It doesn't really prevent OOMs (or panics due to OOM) as the allocator still allows to consume arbitrary amount of memory. The provided check is not able to tell between buggy and legit calls. -- Michal Hocko SUSE Labs