Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp465985rwe; Thu, 1 Sep 2022 02:35:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ur4JEPdxKKEmDYmyxajUQmMerhQw9SGg2pxs16PF5/2HiswBto0dMg3e5hf8yxJvLLIPb X-Received: by 2002:a17:90b:388e:b0:1f5:40d4:828d with SMTP id mu14-20020a17090b388e00b001f540d4828dmr7876436pjb.31.1662024906646; Thu, 01 Sep 2022 02:35:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662024906; cv=none; d=google.com; s=arc-20160816; b=qFjIHKUdEpPWeLr9Ve7p4++dLByh7F8/Fio/hpdsuFVkD6woAwSW2uiiCCgugPhKW9 7n9J9RVN+S7uXcUzkNC2T0WD+Tpo4CICRD3qaqw210+QJIfkuE+Rx4FJex+sUOpiMCV0 isq7v2BGSBsom4YCN0bdwzzkDMTVQ0ghCnbPofJsZAMj9AhmGDV9k+ThINYLVs2iuSnI 1ZVvsvn9/hIKT9v66LjvYINklWZ+Fc3ufDCEjISOoWXpoEIzUfSVImrERW6Hh0oRKwfq Yuz7SxslHYgdie1oMw68PS2eujuKiioeZl4AFjHvyDnP9HSSpRNzi2WI2vyfnpglp7pm oj4w== 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=H0QScilVtxiO5bJJE8A1A5ERc/PXpP1x62UG82vw6oY=; b=J8fqsk+JHNeSEF1qDnsYY6Muo/xjnocffj6OWzjmwp2qjMnBKN/4Xk/plEpwvOw+Q5 lfybPe5b2k5cXRndq8AUd3P23zbcX6tdeL3R8MeFqUCe6haVLuk7nFQsXeYpgb4VhbSF fHWSXSYOViCZRrbjaNLlmraimxvoGp+TiDT3wEKRiGxLXKmrumlhKHEaaLeUmG3oa/e1 oOx1Bm3IzQTHSENW667jQlN673QZRr7Y+483QGV6fL97QCvvHSeNMpiq6LCDpJwM5Jl0 bK+4Z/QjNDaGnGEfBhziqeId5V5CUYd4PDkADCqX8eTnl3oTABsOarSLhwMhn2JjN5hs Wvig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=elM7XrD+; 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 k17-20020a170902ce1100b0016d0be7887csi16929065plg.518.2022.09.01.02.34.54; Thu, 01 Sep 2022 02:35:06 -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=elM7XrD+; 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 S234177AbiIAIkp (ORCPT + 99 others); Thu, 1 Sep 2022 04:40:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233358AbiIAIki (ORCPT ); Thu, 1 Sep 2022 04:40:38 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA44397507 for ; Thu, 1 Sep 2022 01:40:35 -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-out1.suse.de (Postfix) with ESMTPS id 8BA8D223D9; Thu, 1 Sep 2022 08:40:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1662021633; 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=H0QScilVtxiO5bJJE8A1A5ERc/PXpP1x62UG82vw6oY=; b=elM7XrD+NVr/NX9LcMpu4X/xIi1D14H9qc0yzMM+6FqSt1YY7kDszRK+rk2Wpglrc+T93D H6nKlMvrbkFP+U3hZKAw8hKrboKXzLwYR6xFPWRyl81CsgPMoQqUQFVi+RcoVRj5h7DQQw keeCdEZcOG6w2lIMz9NPXjGpkGZiPPY= 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 6831A13A79; Thu, 1 Sep 2022 08:40:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id q2MHFwFwEGMSOQAAMHmgww (envelope-from ); Thu, 01 Sep 2022 08:40:33 +0000 Date: Thu, 1 Sep 2022 10:40:32 +0200 From: Michal Hocko To: Oscar Salvador Cc: Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Vlastimil Babka , Eric Dumazet , Waiman Long , Suren Baghdasaryan Subject: Re: [PATCH 3/3] mm,page_owner: Filter out stacks by a threshold counter Message-ID: References: <20220901044249.4624-1-osalvador@suse.de> <20220901044249.4624-4-osalvador@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220901044249.4624-4-osalvador@suse.de> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 Thu 01-09-22 06:42:49, Oscar Salvador wrote: [...] > +static ssize_t read_page_owner_threshold(struct file *file, char __user *buf, > + size_t count, loff_t *pos) > +{ > + char *kbuf; > + int ret = 0; > + > + count = min_t(size_t, count, PAGE_SIZE); > + > + if (*pos >= count) > + return 0; > + > + kbuf = kmalloc(count, GFP_KERNEL); No, you do not want to trigger user defined allocation like that. I would use seq_file. -- Michal Hocko SUSE Labs