From mboxrd@z Thu Jan 1 00:00:00 1970 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 81BA8C433F5 for ; Tue, 5 Apr 2022 02:46:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230043AbiDECs3 (ORCPT ); Mon, 4 Apr 2022 22:48:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbiDECsL (ORCPT ); Mon, 4 Apr 2022 22:48:11 -0400 Received: from mail-io1-xd2a.google.com (mail-io1-xd2a.google.com [IPv6:2607:f8b0:4864:20::d2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B31010EDF4 for ; Mon, 4 Apr 2022 19:30:33 -0700 (PDT) Received: by mail-io1-xd2a.google.com with SMTP id r2so13580246iod.9 for ; Mon, 04 Apr 2022 19:30:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JTzIzbrqZyK9WcizVERi7qlxh5xxIEK+9IqWImCqDAY=; b=YcMVYnQMKz2NhQbrK0HjGTOXQmTu+Vk9t1j3Nfgnp7gS4pAl9K8ReC7ZTF3NS0ao62 +k6BganfzYE1RHEvww+e/oOwq6C1n3EDSdgXuZrPrUp/3uVwkyfn+h+4qiNGraccB4KQ nIfDzn7o26dbdKpb851QTXPT7ZhljzDSnSko5y404+cDtwPiIHYDokLbazUURxbzDJYf 0wCUTDsNI802WAuIUoPq6xTRWniX7nxbPjm5nqHr5UFiVd2OkMiVpH3V//O4UytUclaa R0jpdX1UgmZmW10eiTYtRmFvTG/l/HJtjLd+9wWEiVF0naJ4VQ9kG+1P5NjKQrF+efCb Vk2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JTzIzbrqZyK9WcizVERi7qlxh5xxIEK+9IqWImCqDAY=; b=gtbOLAwHUQka9GLXwnOhswGA8W2ojY0+R8aIf+TgNK8/X4ymstvgGWFjAVTTMGYa6T zyb/yxhsCUQhRNgfMv7XMi1s4cGfOmi/GRAyIH6evK3X0rLVGXBAzKQRojZUBps8Xfqy FtGioB/zOGUC/n3Z4swmo04YFLddS5oOYS0MstTpYzs9lZ9BGyNGu0pZuev0WNiCbigP 3D+iRd2V8edeDH1EXZ0Ju8cpRaCH4b0r9bEi69BVhvTzzvwd2LRVMPMQI0Q3gOW0feA8 h36tASCIyJmU9v4yXnHNMUHOeBgl+VNMo0PNb2dgmWEoPk5fVvfQ7U3HQ3tE4vnYTAf6 eIPg== X-Gm-Message-State: AOAM533FHwbtUEkUXA2SndxNvllANUtlAw5HbtXdy+z2KpgM8pUczkCN HGO6NEwFA56EA6Mk3XjXt4zSkgmNrSyyBnyvFfbgqA== X-Google-Smtp-Source: ABdhPJwODLum9ilGhChVng+UBA9UPlj2zbdInzRba3Olr4b4wDij4kupJU4FIgzVrCfK1I45tTbjXWS8CK+5nB/27Fs= X-Received: by 2002:a02:84c9:0:b0:31a:1cf2:4468 with SMTP id f67-20020a0284c9000000b0031a1cf24468mr806877jai.31.1649125832511; Mon, 04 Apr 2022 19:30:32 -0700 (PDT) MIME-Version: 1.0 References: <20220331084151.2600229-1-yosryahmed@google.com> In-Reply-To: From: Wei Xu Date: Mon, 4 Apr 2022 19:30:21 -0700 Message-ID: Subject: Re: [PATCH resend] memcg: introduce per-memcg reclaim interface To: Shakeel Butt Cc: Johannes Weiner , Yosry Ahmed , Michal Hocko , Andrew Morton , David Rientjes , Tejun Heo , Zefan Li , Roman Gushchin , Cgroups , "open list:DOCUMENTATION" , Linux Kernel Mailing List , Linux MM , Jonathan Corbet , Yu Zhao , Dave Hansen , Greg Thelen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 4, 2022 at 10:08 AM Shakeel Butt wrote: > > On Fri, Apr 1, 2022 at 1:14 PM Wei Xu wrote: > > > [...] > > > > -EAGAIN sounds good, too. Given that the userspace requests to > > reclaim a specified number of bytes, I think it is generally better to > > tell the userspace whether the request has been successfully > > fulfilled. Ideally, it would be even better to return how many bytes > > that have been reclaimed, though that is not easy to do through the > > cgroup interface. > > What would be the challenge on returning the number of bytes reclaimed > through cgroup interface? write() syscall is used to write the command into memory.reclaim, which should return either the number of command bytes written or -1 (errno is set to indicate the actual error). I think we should not return the number of bytes reclaimed through write(). A new sys_reclaim() is better in this regard because we can define its return value, though it would need a cgroup argument, which is not commonly defined for syscalls.