Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp726688pxb; Tue, 14 Sep 2021 07:29:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz2AmDIr++p6qzgmdWEUNYiUOCy30cYrl7J2thD6cMH/ecgoPvbmxFpZ6ls0FLq5ddYihRg X-Received: by 2002:a05:6512:358f:: with SMTP id m15mr13832791lfr.36.1631629753801; Tue, 14 Sep 2021 07:29:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631629753; cv=none; d=google.com; s=arc-20160816; b=fVXnBcrpEksUU/WJP75oSvcdsAHo0K8+d8thSlSg7pdqxQwXwaT1mkhigUIok+icEw JXAyVjXhxjHryiM4LTsypgn7XIgkVQgNN72WDQr2cUo9khMAP/2g5ITZnvn3OfQql+vb 8U2N4AMsZG1Ve7r9AAEXtoCHYz7R6zMQHOM/vx85d6/eMXIN3kQo5OwW2yMW3fMZyTmT Gzfcz7nUNF2IoFyNOPiTtpK+4fU/ZGo45Of8GPLlLRtGqj+iQLjcDMR82goJQEmzGWCE p/TZczQrv0wWnsLm7BWNMoJKNaXGNGzxhGJLes4ht1N0p7JWuR5aY+6ORxqnJJHvh7ni zmVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vPLjlxNiMy8SE7UjNTK8tngq7pn7HiFIBgi/dU4IiY4=; b=MBLOBPOa1089DCZG2puN6zn3f0wbqjB1yuCdSwJLcl8wkVrQaVZ3eOZw4Ih8wbB+By z3hcTA0TlbeO0y8YB9eU8Ok3f90996OqGJN8orK8WLXRkFb84HG8Oah3nDy6J9c78e9A Vp2EXxbR+WLYNq+ABbIPGBObXb3hewUeez1vTR/+jRH5Fi90mVgOttj07i3THGpmZVjH cK4l2Lcm+Km8xh9TpJJ4GvhJGkf+WsvQY7k0E+ZIfqIvoXD95jtC3LJRQu190ox2Z54v cx+h23X6lClWi1pfs0t08TJ2ZvCSU84uIzdM/gGzDcJfRk5v7uqXp5IrUrX9A6GheeCr MZ9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RHBOwzDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m5si18254052lfc.568.2021.09.14.07.28.45; Tue, 14 Sep 2021 07:29:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b=RHBOwzDG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233630AbhINOYj (ORCPT + 99 others); Tue, 14 Sep 2021 10:24:39 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:36372 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233437AbhINOYh (ORCPT ); Tue, 14 Sep 2021 10:24:37 -0400 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 6A5261FDFC; Tue, 14 Sep 2021 14:23:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1631629398; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vPLjlxNiMy8SE7UjNTK8tngq7pn7HiFIBgi/dU4IiY4=; b=RHBOwzDGUJPzZPe5F1N+ijWFfwWf18Vb1viFqcFbzGn1pNyswLU9xhfJWkC3kfqxfT3cQK ASD9bWHOnAZDFsQpQ1ynhod/htXkglaRNsUdBxKpn7/nI/xk19+CoO4aINaWO4k22bBslH d1n25oTi+dd0w5BtyfqC7w+1HHmLwYM= 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 4BD9513B8A; Tue, 14 Sep 2021 14:23:18 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id OaVTEVawQGGacAAAMHmgww (envelope-from ); Tue, 14 Sep 2021 14:23:18 +0000 Date: Tue, 14 Sep 2021 16:23:16 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Michal Hocko Cc: Shakeel Butt , Vasily Averin , Andrew Morton , Linus Torvalds , LKML , Johannes Weiner , kernel@openvz.org, Cgroups Subject: Re: [PATCH] ipc: remove memcg accounting for sops objects in do_semtimedop() Message-ID: <20210914142316.GA23024@blackbody.suse.cz> References: <90e254df-0dfe-f080-011e-b7c53ee7fd20@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 14, 2021 at 09:13:48AM +0200, Michal Hocko wrote: > " > This object can consume up to 2 pages, syscall is sleeping one, > size and duration can be controlled by user, and this allocation > can be repeated by many thread at the same time. > " > > It sounds like a problem, except it is not because? A worst case > scenario evaluation would be beneficial for example AFAICS, the offending allocation is in place only during the duration of the syscall. So it's basically O(#tasks). Considering at least 2 pages for task_struct + 2 pages for kernel stack, back of the envelope calculation gives me the footprint amplification is <1.5. The factor would IMO be interesting if it was >> 2 (from the PoV of excessive (ab)use, fine-grained accounting seems to be currently unfeasible due to performance impact). The commit message can be more explicit about this but to the patch Reviewed-by: Michal Koutn?