Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1499402rwe; Thu, 1 Sep 2022 21:17:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR4GUeiFraCaIG/MRzk+4tw5JiYogj7ECVFADJl+U7A6NEfIyQnXkxvLlDxb2oWsMRTwbfUQ X-Received: by 2002:a05:6a00:16c4:b0:535:890:d4a with SMTP id l4-20020a056a0016c400b0053508900d4amr34504299pfc.0.1662092232592; Thu, 01 Sep 2022 21:17:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662092232; cv=none; d=google.com; s=arc-20160816; b=fKlQImLKJ0yUVmJ+BgkDxEgKJyovbn1VqPW9oTusyyB4xEMJkkqzi6kmrauOTuJVnV nO7N2ZGhGDyHXEsnVVTByONEcXF3SMb5xFuas64G8XY9kmU/W6PVip0HVi22OxeXmnFn gbTIX6V8LV8S3y7mECdL0oGQKstL7E3qexFY6wBeRvhmcbJn8Z+tGAhEtpVcR7VyerhA UAHf3QXOAJM/ncmGe3iE4a2YTzE0vaCmssVz3jIxE5peJJ4bbnOJENj8de0ocToUT1W+ Ico9tmxrXE/CV85Sq1qemxDQSgG2Frd+iqHbp2SpQiTAi3FDuRmVuC3DwroZ2v24ZFCx b0Xw== 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=eIdTt/sIs/p9Y5wl0IOT0Yq8IRs/zFnc8Crxg9PtTRo=; b=lgaBxHo0hlKgv1MgTI2njT2GhrsT+vq4ShnvKVG5k48VlI0NY+EMrjZjrQoDX4oJI7 t+RHCWRVMWGE/9CZPVv0zAfyPgacER+cmXODN+v8onMcKtMN06esItPRdqAoqk6fOJ3a XHtK6AyI83oExv4eYJ9R/j072l/WlfuQ96hB/WV6CC40N7ioQwt2AGpd6UnVBp8mr4Kc 7ACYsBJzKlpVS51E84RTtjJSznqDFnlU2oRHH0zudBn26lDEbmMCUZHdZVquR1p8vM/E ffe6B8jfS8aSHSWOCRH5L0fA0ASyN/wT1RhsdFxgX4Ry5YoK+OznEwW3f2aY0964DAyG 1y4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=V1uhk2dF; 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 x186-20020a6386c3000000b0040512c0ebfcsi868410pgd.297.2022.09.01.21.17.01; Thu, 01 Sep 2022 21:17:12 -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=V1uhk2dF; 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 S233250AbiIBDdh (ORCPT + 99 others); Thu, 1 Sep 2022 23:33:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47688 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233341AbiIBDdb (ORCPT ); Thu, 1 Sep 2022 23:33:31 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D14D4AB063 for ; Thu, 1 Sep 2022 20:33:27 -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 B1F7E20A7E; Fri, 2 Sep 2022 03:33:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662089605; 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=eIdTt/sIs/p9Y5wl0IOT0Yq8IRs/zFnc8Crxg9PtTRo=; b=V1uhk2dF/9U+V+IAOcbxe9njvdvA3xHj4GLDsJ9pPFDmko57bd+QSh5b2j9B/3veu28LxX YvESnUu4m62LHlYn6M0GW9shUzQyO8WDFM5jLqyeG6pREpI3nKuWDGedYLHf9nZw+EVC0n Cs7nusZ2UF1UZ/beb1OTbCwqvmmOpvk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662089605; 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=eIdTt/sIs/p9Y5wl0IOT0Yq8IRs/zFnc8Crxg9PtTRo=; b=lCcyAGqaOzmiGz+xtHfVjAi03RqCKlGGm29yRFeYGkR9bdVQhFL9+qal7Ux/+HSww6U4Rh 7QGk9KWYn36K7QCw== 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 234B3133DD; Fri, 2 Sep 2022 03:33:25 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZMTaBYV5EWNoDgAAMHmgww (envelope-from ); Fri, 02 Sep 2022 03:33:25 +0000 Date: Fri, 2 Sep 2022 05:33:23 +0200 From: Oscar Salvador To: Ammar Faizi Cc: Linux Kernel Mailing List , Linux MM Mailing List , Andrew Morton , Michal Hocko , Vlastimil Babka , Eric Dumazet , Waiman Long , Suren Baghdasaryan , Ammar Faizi Subject: Re: [PATCH 2/3] mm, page_owner: Add page_owner_stacks file to print out only stacks and their counter Message-ID: References: <20220901044249.4624-1-osalvador@suse.de> <20220901044249.4624-3-osalvador@suse.de> <9f2ef1ac-c0a1-eb77-8e68-e9a60bc8efd2@gnuweeb.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f2ef1ac-c0a1-eb77-8e68-e9a60bc8efd2@gnuweeb.org> 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 03:16:44PM +0700, Ammar Faizi wrote: > On 9/1/22 11:42 AM, Oscar Salvador wrote: > > +static unsigned long last_stack = 0; > > This @last_stack can just be a static local variable in the new > function you wrote, read_page_owner_stacks(), since no other > functions use it. We could certainly do that. > > > +static ssize_t read_page_owner_stacks(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); > > + kbuf = kmalloc(count, GFP_KERNEL); > > + if (!kbuf) > > + return ENOMEM; > > Missing a negative sign, return -ENOMEM; Oh yes, I overlooked that. Thanks! -- Oscar Salvador SUSE Labs