Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7D7DC636D6 for ; Wed, 22 Feb 2023 04:04:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229840AbjBVEEM (ORCPT ); Tue, 21 Feb 2023 23:04:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229589AbjBVEEK (ORCPT ); Tue, 21 Feb 2023 23:04:10 -0500 Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ABEBAB777 for ; Tue, 21 Feb 2023 20:04:08 -0800 (PST) Received: by mail-lf1-x130.google.com with SMTP id f18so8407949lfa.3 for ; Tue, 21 Feb 2023 20:04:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2Yt/rtAUjC8oE//IhVQKInejbXflDY4md7Xx+ezyrLY=; b=PlCZNxI6YaoiNHUimwzbfONmZvR3sfewbs0X07QALDVOrrxpCUFYZsoOhBAOI6wa74 qGIZyVqEkF9Loyx7H3H9ZH8O/m08FrEGlDX6iP31P2VKJIixcgaVqjWx5PkDEaHo2GOd QWdqEo6qaObAubvJSssFXGDcKGgi/kFMrI/4c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2Yt/rtAUjC8oE//IhVQKInejbXflDY4md7Xx+ezyrLY=; b=j80NhjPoDTTCcFJU9FDcWRixF63rvBnDHbGA52ayzHQivvB6vDhImOA/fnwaH95A3P KgAu7TvLeXQBROOySURXWCMKhscIDY/umRNzH/aFALhQ6WiHOLRPlgehhzjqyCbtU2PR ykNOBUwdYDEkw62P2SiRQvwQmJP6Hk5sBezVoX5xQ6X0B/QFnLpEeZsoI3jq5ZD2DKgD +egqTjWquf3E8bngDnXcmZ+cVjafcZ7La/tXPw0U85554JkaH+Ln4z30g+GCljU1lZbF CI0u/QB3mUUDkPxcdYYOTZPocMzgUZK8z1ib6uAXFAIiu7YG9b4M6xGhID4I+Lg7fDLf Wrtw== X-Gm-Message-State: AO0yUKUgw/2xPnVR5ny2tBJuL3yQc88AjWXhK5iwTDPSusZWpdjBqgTJ grZhqKjzGfzdIoZ5aQAygQmNXNzLCUeBd1U+IUqqZmJlj5k+AD5M X-Google-Smtp-Source: AK7set8y2i/Pyooxg/uGB4gmq0f1CWgV03knLK+LIWN1PjLs9XMWKgkHNXYCRaI11gv0/HSn9Wh9/Q0yJf7QGtRUCQ0= X-Received: by 2002:ac2:46db:0:b0:4d5:ca32:6aec with SMTP id p27-20020ac246db000000b004d5ca326aecmr2399509lfo.12.1677038646988; Tue, 21 Feb 2023 20:04:06 -0800 (PST) MIME-Version: 1.0 References: <20230221214344.609226-1-peterx@redhat.com> In-Reply-To: <20230221214344.609226-1-peterx@redhat.com> From: David Stevens Date: Wed, 22 Feb 2023 13:03:55 +0900 Message-ID: Subject: Re: [PATCH] mm/khugepaged: alloc_charge_hpage() take care of mem charge errors To: Peter Xu Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Johannes Weiner , Yang Shi , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 22, 2023 at 6:43 AM Peter Xu wrote: > > If memory charge failed, the caller shouldn't call mem_cgroup_uncharge(). > Let alloc_charge_hpage() handle the error itself and clear hpage properly > if mem charge fails. > > Cc: Johannes Weiner > Cc: Yang Shi > Cc: David Stevens > Cc: stable@vger.kernel.org > Fixes: 9d82c69438d0 ("mm: memcontrol: convert anon and file-thp to new mem_cgroup_charge() API") > Signed-off-by: Peter Xu Reviewed-by: David Stevens