Received: by 10.223.185.116 with SMTP id b49csp196555wrg; Tue, 20 Feb 2018 19:03:45 -0800 (PST) X-Google-Smtp-Source: AH8x225KI/yps6TDI5vmL2OLNNMH93RgFVLUD5KBGM9pa+d2xbMgRLh3tYIxUn66Mr2oGA1wrYQ2 X-Received: by 10.99.110.133 with SMTP id j127mr1477000pgc.79.1519182225642; Tue, 20 Feb 2018 19:03:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519182225; cv=none; d=google.com; s=arc-20160816; b=iwg8TQ121RJfgDuvOlp1MGsPw6UTJQZslK8FrppdCojASm/C/N7EHgf/IjN+smI4bo O7Zw3c25Nel3PhBTARDzWzw59MVvVglcKrMDpNijryQRK9c8fPvSHIEwBFR/FjP/40LL gTRvYa7KjOfz+4aVgicV+hTolT7WDxFDbJ/rTzAMNI+V6eS4vrIGcnAkStlzSIq3WDGu lF/5MYsonlrTZvwKk40B0Zm2JUKs+lRwsOCHI0KGUYCapPf7kJP+4DXOmQY5bDGlKiP3 X57Zm5nFVj5hvfqxb3JGisRP8jIEunv5NIMHrDzNjQQvtM8JhlR9LzUbIY9znflHno8G vQcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=mnR1OSZhS9YXVvCTrjh/S8rR1XL5YJrsaWzwoGFaazU=; b=mJFqepgt/jmtGoNqzLSRVGQs2+6o/E6LAsDUUclfsiN8hnRupFMf6a2lrwk0bJ1YHr gp04sjGGpEGOnT1Nbe5CPPDRtbIBtVrzFB9UYLqLeuyFnQDWlprApvUy4Wmjv5mdd0Pn QTqAvk7u4BYLXmh6BoPqHBBBDhNzZ8bXQvlrXRAihaolsgc+OmwRivn47pb5jGQ3nFQH QiG7KmHZ2VQez8xmD2krNonIwkqKEp0Id6tJhQhzQjIncwPnGe8UbiNjjjLUNnCzGt2/ UNUgOKtHPbec8O7J3dCJ1p3wsj0udnCd95ZPNC2WaKI6lmmWd5mC+doq9h9A9U6YE7TH 7/tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gpCkpSiP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 66-v6si1225026plb.314.2018.02.20.19.03.31; Tue, 20 Feb 2018 19:03:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=gpCkpSiP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751420AbeBUDBi (ORCPT + 99 others); Tue, 20 Feb 2018 22:01:38 -0500 Received: from mail-pf0-f194.google.com ([209.85.192.194]:36039 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751163AbeBUDBg (ORCPT ); Tue, 20 Feb 2018 22:01:36 -0500 Received: by mail-pf0-f194.google.com with SMTP id 68so130798pfx.3 for ; Tue, 20 Feb 2018 19:01:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=mnR1OSZhS9YXVvCTrjh/S8rR1XL5YJrsaWzwoGFaazU=; b=gpCkpSiP6Vkyh4wZfEMG4WIuRKaO7TcZeqRddlLZ9a47g2lYceh9KUaJ6jDgF0Gi39 LZSu9Ha1FLtlFttqay9vCjYh6C2fG/D7XIGTHxnR1U7iCH8IogJrgsKVGK9RSdiBDoH9 BAT4MrjUEuV/rbZ9PKDyLDYJxudV7lfqukRdULNIOcasVu+jG0+VW3nAh5+UT4MNLfdR vQeZkoeqHPhl0sDZdjC25hiLT6Maef+hvyxqGFvCJ31KJiZL4pp1lTY2ocg/RuvVEj7o PtWL3qe76zvAyej8MTC4nLcKh0xei1whShP/VUiR5qw5mVm8J1tM6TbZRQ2J43ZfNipb ekDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mnR1OSZhS9YXVvCTrjh/S8rR1XL5YJrsaWzwoGFaazU=; b=BQdUDPoB2EALcMwXnXYfUoM1MFSR86yIWXQnJwGTSOdG9PvQymO3b0xzFTXnILWZJV C7QGENaIBHQrVgbyGRXJABTRIz/cEGKCAEfpto0E1jA5Ozpt/2FZJiiIO5f82nBcga5u lPX6Vp3PiGlpziIqsYzeY8dya8RiXlvbhCLzORDg3gUiqXPKh8wPNqFHPW9au0Pj9zRy 7rskdg9BR7XKJOJhkWL5tdsoE3+0DWve8SQZpmJYPjuxK8swRW4u9i6rSHVcA8TGNFDR GsndbrkhsfsGQbPEHTAEbo9e68VakGJWPMa2lCE+N9eLvVF0ZN9otE02CiV3bXzhW2cV dgiw== X-Gm-Message-State: APf1xPAUW37ZA1dfFH9A2nEf7LArx/p+UtG/EjB+ZmxAjrIuF87FI7Y2 9533VAayikTyrHnOk+zhqSvZIQ== X-Received: by 10.101.97.139 with SMTP id c11mr1426958pgv.435.1519182095687; Tue, 20 Feb 2018 19:01:35 -0800 (PST) Received: from shakeelb.mtv.corp.google.com ([2620:15c:2cb:201:3a5f:3a4f:fa44:6b63]) by smtp.gmail.com with ESMTPSA id b5sm23230739pfc.12.2018.02.20.19.01.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Feb 2018 19:01:33 -0800 (PST) From: Shakeel Butt To: Jan Kara , Amir Goldstein , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Greg Thelen , Johannes Weiner , Michal Hocko , Vladimir Davydov , Mel Gorman , Vlastimil Babka Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, Shakeel Butt Subject: [PATCH v2 0/3] Directed kmem charging Date: Tue, 20 Feb 2018 19:00:58 -0800 Message-Id: <20180221030101.221206-1-shakeelb@google.com> X-Mailer: git-send-email 2.16.1.291.g4437f3f132-goog Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces memcg variant memory allocation functions. The caller can explicitly pass the memcg to charge for kmem allocations. Currently the kernel, for __GFP_ACCOUNT memory allocation requests, extract the memcg of the current task to charge for the kmem allocation. This patch series introduces kmem allocation functions where the caller can pass the pointer to the remote memcg. The remote memcg will be charged for the allocation instead of the memcg of the caller. However the caller must have a reference to the remote memcg. Fixed the build for SLOB in v2. Shakeel Butt (3): mm: memcg: plumbing memcg for kmem cache allocations mm: memcg: plumbing memcg for kmalloc allocations fs: fsnotify: account fsnotify metadata to kmemcg fs/notify/dnotify/dnotify.c | 5 +- fs/notify/fanotify/fanotify.c | 12 ++- fs/notify/fanotify/fanotify.h | 3 +- fs/notify/fanotify/fanotify_user.c | 7 +- fs/notify/group.c | 4 + fs/notify/inotify/inotify_fsnotify.c | 2 +- fs/notify/inotify/inotify_user.c | 5 +- fs/notify/mark.c | 6 +- include/linux/fsnotify_backend.h | 12 ++- include/linux/memcontrol.h | 13 ++- include/linux/slab.h | 86 +++++++++++++++- mm/memcontrol.c | 29 ++++-- mm/page_alloc.c | 2 +- mm/slab.c | 107 ++++++++++++++++---- mm/slab.h | 6 +- mm/slab_common.c | 41 +++++++- mm/slob.c | 13 +++ mm/slub.c | 140 ++++++++++++++++++++++----- 18 files changed, 415 insertions(+), 78 deletions(-) -- 2.16.1.291.g4437f3f132-goog