Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1439469lqh; Mon, 6 May 2024 07:49:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWXvPO6XaXafu9RLfKlRHvgpRMjXnxZWQITZwDR8MRRpy6BlQHDt9lbz+VlV45lpCxAXJrxxv38P83KTjHLvtzrbJHpE0i53QO31YDtgg== X-Google-Smtp-Source: AGHT+IFh1bVP5g6vrkOW/zzWhRVbKusMkkgko4f2VcYAAP1qlFw3svA96z4BvMwKg1NdZ4kzE7DC X-Received: by 2002:a50:d4d3:0:b0:570:cd6:8ef with SMTP id e19-20020a50d4d3000000b005700cd608efmr7920827edj.29.1715006990465; Mon, 06 May 2024 07:49:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715006990; cv=pass; d=google.com; s=arc-20160816; b=mSddZ6vL3kWV6BwO8f+EQ2Akl0fQvns7zWHFHQZgQ7Rgak5rH1cRK7ye/09TTZcJjz JfZxEmd6KBvQ7j55wLlqmBCOH7phORdUj26XXKJXdM1ImqU5LQ1i8G4zpSA+OOb4MdP7 5IBBvXxPiNHsf5/usX9nJgXvPWLf0FwSi+vXrDCs8yQGXuN5bVzIch4BSEREZhDN8Mkx 5HN+/SXEd7y/mcCRfYFw5/6UJLedJJIFOn0rMl/4ONIlg4VuE7uQPGL4EhBhqZ1KgUyd gEqI1lpa92F9BD8BXQn8qL4joahYvRBmL0a7SkDTyrft+L5lg8MV3SK9lrd8/OF3M+gg tpYw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature; bh=8SjI8VAl0W+J1vcR3bFCMW1ShLhq8ix+ki0A3tbAkyc=; fh=DoxxUv+sEe9/kfZ04oZrt5oW7iuHJp9UkE8TiUGYDO4=; b=SojP0rWBhiPwjdznbAR+hbjOmf2XdWkKwVpxPJ17vWkuPVl3auc/iAkjbbFrCaIeI/ GScKcEGbI+gKZStcFuq/ezNzqdvXyPTTvZ5mlYNHY+nHUclxldj7mEUWUljw3bthUouW QTSnCIa3MFDyPAajt/0Kp/Fwi4nRIIBFPp5PrKHM5Ow5/gpK+g2hgEtuZkx8eJJQLJ67 yqXJ4dVcnZqVEPWPZidml7ZPDaI4p2eWRAUDiDvHfuysDzpaPJMAjAEgsQudyFBkicIT C46XG+MJFh/mvvXQ61qwqGnv0/6gf4KD4QL0WPdCcSke5IjOojM1mL/9ywRxPlb2UfyT SDXQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=h+nh5+x9; dkim=pass header.i=@suse.com header.s=susede1 header.b=h+nh5+x9; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-170021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id e18-20020a056402089200b0057223d7ea6dsi4847185edy.51.2024.05.06.07.49.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 07:49:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-170021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=h+nh5+x9; dkim=pass header.i=@suse.com header.s=susede1 header.b=h+nh5+x9; arc=pass (i=1 spf=pass spfdomain=suse.com dkim=pass dkdomain=suse.com dkim=pass dkdomain=suse.com dmarc=pass fromdomain=suse.com); spf=pass (google.com: domain of linux-kernel+bounces-170021-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-170021-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 379B51F221E6 for ; Mon, 6 May 2024 14:49:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E0E0B153811; Mon, 6 May 2024 14:49:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="h+nh5+x9"; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b="h+nh5+x9" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6ED4C44C81; Mon, 6 May 2024 14:49:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715006982; cv=none; b=jIFAdCSXdOSEZgFmfgypeG6cnEfM8GSuYHug8+i30YVo4HEXOFc5yJzprG59KRC+5bKpQe30g3IIQ0NTujIgCEe40xFMycJh3P8RK2QZ2b6VYbk168Op0dHjSfKI4Z/BEX4fNlzzAu0vIInBn4h4Tzezn4xlUHMfbj4VxX3LG9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715006982; c=relaxed/simple; bh=YaT9TitsE4+neqbGRaiWJj3h0o7SRpwaRAiRg6Sesg4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ZdhCksdo2xov0gS5wVLdhLdX2bancXIGQoHju4FcYqyMxU1JDvNxKAb2erRG/Mtc/3DRJk4+S9yNPsJprlVG3bVaxD9+TPPLHlvn14W8C+T00Fah/P3BVMrw+hzKJTdFrx6G/9Y6J5Gas4UGmmEsG80RgBhTIccgSp9i+XEwNSA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com; spf=pass smtp.mailfrom=suse.com; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=h+nh5+x9; dkim=pass (1024-bit key) header.d=suse.com header.i=@suse.com header.b=h+nh5+x9; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=suse.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.com Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 8AF245FEBF; Mon, 6 May 2024 14:49:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715006978; 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=8SjI8VAl0W+J1vcR3bFCMW1ShLhq8ix+ki0A3tbAkyc=; b=h+nh5+x9CTVXkLIHwAMBIkfOqiSzV8va338K+8d2goT4GNJXbBH/PXF7/vYGaYV3yRAeDl daQ6gOABZeqq9pqH50K4zoX57RIJkoEJgIBLfMooRc8osmDOjRK7k0qWCpLXbFzJlWa8+M 50oJXSS6z2v3NnSbosVXVRtBbeI0oMo= Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1715006978; 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=8SjI8VAl0W+J1vcR3bFCMW1ShLhq8ix+ki0A3tbAkyc=; b=h+nh5+x9CTVXkLIHwAMBIkfOqiSzV8va338K+8d2goT4GNJXbBH/PXF7/vYGaYV3yRAeDl daQ6gOABZeqq9pqH50K4zoX57RIJkoEJgIBLfMooRc8osmDOjRK7k0qWCpLXbFzJlWa8+M 50oJXSS6z2v3NnSbosVXVRtBbeI0oMo= Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5973413A32; Mon, 6 May 2024 14:49:38 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id fMt6EwLuOGYldwAAD6G6ig (envelope-from ); Mon, 06 May 2024 14:49:38 +0000 Date: Mon, 6 May 2024 16:49:33 +0200 From: Michal Hocko To: Matthew Wilcox Cc: Xiu Jianfeng , hannes@cmpxchg.org, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, akpm@linux-foundation.org, cgroups@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] mm: memcg: use meaningful error code for return value Message-ID: References: <20240506133643.1124102-1-xiujianfeng@huawei.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Flag: NO X-Spam-Score: -3.79 X-Spam-Level: X-Spamd-Result: default: False [-3.79 / 50.00]; BAYES_HAM(-2.99)[99.96%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; MISSING_XM_UA(0.00)[]; RCPT_COUNT_SEVEN(0.00)[10]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.com:s=susede1]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_DN_SOME(0.00)[] On Mon 06-05-24 14:53:47, Matthew Wilcox wrote: > On Mon, May 06, 2024 at 01:36:43PM +0000, Xiu Jianfeng wrote: > > alloc_mem_cgroup_per_node_info() returns 1 if failed, use -ENOMEM > > instead, which is more meaningful. > > This should probably be changed to return true/false instead of > an int. Agreed. Or change the only caller to consume the error. Changing to bool seems like the easiest way. -- Michal Hocko SUSE Labs