Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1480734rwe; Thu, 1 Sep 2022 20:49:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR4e2NDPlHaLDJgnlNyIF/768w9aDmXd7XfJpYzTyRWDeyQ/BoLhhJG1MGcyRgVwecJuN1sf X-Received: by 2002:a05:6a00:99b:b0:536:754a:ab31 with SMTP id u27-20020a056a00099b00b00536754aab31mr34276747pfg.45.1662090544725; Thu, 01 Sep 2022 20:49:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662090544; cv=none; d=google.com; s=arc-20160816; b=FRCuSaV7iEyMsK3VPm/Dn9Eevn5nebr1+tmM0BHDhXLt0cXz3pR7pfcuA9cWQS52fc e8vLsvWq312ehGwz5VzQd4WVmXD8XMHj7pSEfD3aBvJRruVzBQVFmmyz+FHSuZpYWRcL xEpxjpvJZrAzu6VnixLr6JGwdpRx4v5pCjOxKsuomYCuVadNE2lJwCVmdKigfwLOXlmh 8A6dsFT2hasuExN94O7cca4tcR6FezMlA0pygJWlNpCfuPdHFlVhQv4Fa6U04h6vEF+N yf8y3/OmLu9ph+aaeewwERD0aDm2lITzp8mnU/g7H9T/XXDkIltX8LN4R2kHwtQNrJSI 0Rkw== 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 :dkim-signature; bh=DI3GzIroG9Z+gelwHW3Ud5RXkeyLPq2aEkpI5BDoZSw=; b=fNxM0cAjRF89+m6+9OiAYdB455+YVcIhYOLXBy1mIWoxzrtfPW2DyXc3A9m6IH/2mp HsQifOVLLqmOKTVaE85Vyx5EesKEJZPt2D/K7HssjNGpPeVYBloJbaRVn4pe+rbEwz2j uPVkO0SvhcxNAokz+GjKn3GOh9x1gpcmdgvH5NobCndZyVCaIijiEeF2GvadfRHjZdha JvmazSQQc+WQqpZTlUmD5BXc3c3YWnY8wX13i9/I9zFBjCbe8iXcGDgQmDZ8Kvvfj/Gl LeVlEVWMepY7Xbk16gQ1HQ1tDc20q8inVr2M/Iu2jBpeIBOqU9snyIlpKK8wIGt33eVu jVag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=L2xXFpSm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t26-20020a63535a000000b0043090079fa1si708302pgl.751.2022.09.01.20.48.53; Thu, 01 Sep 2022 20:49:04 -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.de header.s=susede2_rsa header.b=L2xXFpSm; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235257AbiIBDhV (ORCPT + 99 others); Thu, 1 Sep 2022 23:37:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52694 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235106AbiIBDhO (ORCPT ); Thu, 1 Sep 2022 23:37:14 -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 387B62529C for ; Thu, 1 Sep 2022 20:37:13 -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 E877533D70; Fri, 2 Sep 2022 03:37:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662089831; 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=DI3GzIroG9Z+gelwHW3Ud5RXkeyLPq2aEkpI5BDoZSw=; b=L2xXFpSmTEGE6FRw07qcHWG0VItqsbhBM2+jeEoRx/z3MpHrP1rnretBF1tisN7yaIssk6 ZwI3GdIbDPgaQGbtlQMlVUDm7nf1/EvBiNonEnTvldEDxMicKQHY7/zIUPYJXajNnIx0wc XEkhtd0b+rQla/eN47IDlst49DM7IB4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662089831; 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=DI3GzIroG9Z+gelwHW3Ud5RXkeyLPq2aEkpI5BDoZSw=; b=0bm2D7GTEKl/tCM8+DAcI8dU7ouMBIo0Ve525Q/ZRTSr/Q9HVfFhYL7PTWATjKErOSx8jn Py1vqPuOMmVaeOBw== 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 6E62C133DD; Fri, 2 Sep 2022 03:37:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id We8xGGd6EWPBDwAAMHmgww (envelope-from ); Fri, 02 Sep 2022 03:37:11 +0000 Date: Fri, 2 Sep 2022 05:37:09 +0200 From: Oscar Salvador To: Michal Hocko 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: 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, Sep 01, 2022 at 10:40:32AM +0200, Michal Hocko wrote: > 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. Sure, will use that. Thanks! -- Oscar Salvador SUSE Labs