From patchwork Tue May 29 21:17:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10437075 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A04E8602BF for ; Tue, 29 May 2018 21:17:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 91C4F28991 for ; Tue, 29 May 2018 21:17:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86A2F2899C; Tue, 29 May 2018 21:17:45 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 029C828991 for ; Tue, 29 May 2018 21:17:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 788F36B000E; Tue, 29 May 2018 17:17:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 5F2AC6B0010; Tue, 29 May 2018 17:17:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 41F406B0266; Tue, 29 May 2018 17:17:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-qk0-f197.google.com (mail-qk0-f197.google.com [209.85.220.197]) by kanga.kvack.org (Postfix) with ESMTP id 05B776B000E for ; Tue, 29 May 2018 17:17:36 -0400 (EDT) Received: by mail-qk0-f197.google.com with SMTP id x186-v6so14873700qkb.0 for ; Tue, 29 May 2018 14:17:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:subject:date:message-id :in-reply-to:references; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=S/X8AdIKSSaqQyrIzG9l7BjtXYavJsz9cFjk+Wo5NL4T7CqxLLIOU9Kt7t+0qsmXtK ulN028leknaZYHB3dVfi/K7LjLtQNgvofWmjrK0BSCQez49MdU7Z7EOTCAUiwEzpSid/ 49wlkTn5VgAynShyVJas5xIBPI7Vm/5dKjvBWY8zWuBMllxOOnYZzDUFBSqmZ31vVJaP /mVxv6iVYBsrqWjSAOUlTydaNZKsmoW4TzoTX979BlB0V+wtH7QXge6kGNXwnEc2ZFOo L0fMmbmMV1sulvtZ+JjTaDDDUR+TMPA+aPJ70UpaZp5YX3P8NjqgHwt7ufNZv7kWX/7N P5eA== X-Gm-Message-State: APt69E3DF+zhDQyRRf0Po2jL+8eydhQTO0CcXyHOPtd+aIBVaxbMEZ9I 6wb2FZ3FFeIhgMkf/Tjq8jfKtA0B9wIeRQ+9LrJEKgrfgEC7JCY2n6xmfOIn/4m70+x06hhrDwB Y0HXqrQQogpX4wTPR00KAL9HdHhAgusVI/8DucB2nG+0QTP7wCt0dqTWEHJVZeOnSkv+N80UJp+ rVJgwmP8Kh3LNB06zP+lK78WLtxdjCKTdhRKZXBoEChoLZ/PF1aE72zv/W7nmLTL6Vs8fwd5wgT +faj/6z91LIN/E1yBBTaFu/Ecyu1RJbE+kA3zN+KcwH0Xp00JkDcJeykjkbYKUSPWl5xxNsAs7g CsOfOVlnoDHya4/nm2AIVWYKPa6JUEPU+lnwy1tAj+5OJmeg5uuF0soz+nsAhGAFsGltwGZLdpo 5 X-Received: by 2002:ac8:a44:: with SMTP id f4-v6mr69269qti.45.1527628655820; Tue, 29 May 2018 14:17:35 -0700 (PDT) X-Received: by 2002:ac8:a44:: with SMTP id f4-v6mr69239qti.45.1527628655294; Tue, 29 May 2018 14:17:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527628655; cv=none; d=google.com; s=arc-20160816; b=jyjsZ9KmsXfhlhbjVv5pyhTDfr1NBWflE+GKf/kdifC5TbpicxTR15yUi3vgFeMjhc +Bd1J6j3pi9w2hE/TUCVLk37KEvCuce5r9izB/zFRkSk6pzE45iAI6Oo8wXahRJTjUXx wd+DmU5tqiyWZUmgax9EETTGWefEQ7y5pKlvnLwy0llCQ3bvHLJotowRQb2LdU4kvjQS a/0n7JZSytk8Kh2DSHMyMHL9uGZBgDdzkTyGPSjJF2J/GsSj4YfFcybSFja0NSe+jZpn OUF2DCrJD23QJ5C76FijCq332O0ViAiolPXWAbQKSkspkSHYNJ4yPrF3gClVd0orlFj/ kHzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:to:from :dkim-signature:arc-authentication-results; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=hIcnZxDUoAHcmWRnI+Z++Hl3Chn5KtB6iFgXcMvisXGR4y0jE8ffn3mfecrN7SVqmj 1+bm/0tFP/IGOOSR38CTCwbXfc4cjpYw6vWveemjzFsA8V9n9oh7DB0WnBSK3a+vFjIt yL6smlsNlBkXc8SB92Q2egKs/K3aZRJpL4xcWzhuWqj4lBPLaSnD71XB0VBcuwJo0NNf qDIEDNeXWIhDe4ytw9xuK1avuhgmTIg/zhg3h2+QH155nJVMgepLhs9Y+z/VMw8/l0Kz fpNSww6/evvNw7C1hLOeGbiNzcYHq5HyG79JlhAuhVm1EEwakMKgI7PO4snoVdRImGZz ibaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=W34Q8/aK; spf=neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of josef@toxicpanda.com) smtp.mailfrom=josef@toxicpanda.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id b4-v6sor19056893qvo.134.2018.05.29.14.17.35 for (Google Transport Security); Tue, 29 May 2018 14:17:35 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of josef@toxicpanda.com) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@toxicpanda-com.20150623.gappssmtp.com header.s=20150623 header.b=W34Q8/aK; spf=neutral (google.com: 209.85.220.65 is neither permitted nor denied by best guess record for domain of josef@toxicpanda.com) smtp.mailfrom=josef@toxicpanda.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=PN/nWKQLg21E/rV05t1OoXBNqfvsbn3JrFEdFIuPAYQ=; b=W34Q8/aKBX/6YXFAvZB3haDDoRmC3DTSKid8xBURzXPA/5Oke3emCvD0yLAJSeKFCW QRxlemMpVFYdxZE3AkfNJ+/easTLtVqbEV8Qsfd5BsGbSj1gF6bK+da4pTpoykcTU57q Ey7tTlrfQi76OIm8S6KqFlyrMAKY+TZajEzyo1SjOm+9tn6Vhe1xQM5jycs6y3rRi/4r zkG4AVNyZ2E3NCpbkf5PPgNYjOqD3DUPajFEEZMhuhjjXXXS0urwgJDRhaRpiE50sL/f DDE8Z7vD+KEEhj0ZHl7zxV5jH4g6qlgJkYhtqVNG/nc7rLvpIzXRD3a572cLJ4bJBWPo sR1w== X-Google-Smtp-Source: ADUXVKJeWmMLx5ZuE+IcTSuh3RBDVubhd3d+6lx7Q/yHSizuSngCDVAPYfAevChwgZtdVduNU7tBsQ== X-Received: by 2002:a0c:de05:: with SMTP id t5-v6mr81380qvk.180.1527628654948; Tue, 29 May 2018 14:17:34 -0700 (PDT) Received: from localhost (cpe-2606-A000-4381-1201-225-22FF-FEB3-E51A.dyn6.twc.com. [2606:a000:4381:1201:225:22ff:feb3:e51a]) by smtp.gmail.com with ESMTPSA id 3-v6sm10641280qtx.16.2018.05.29.14.17.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 29 May 2018 14:17:34 -0700 (PDT) From: Josef Bacik To: axboe@kernel.dk, kernel-team@fb.com, linux-block@vger.kernel.org, akpm@linux-foundation.org, linux-mm@kvack.org, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, tj@kernel.org, linux-fsdevel@vger.kernel.org Subject: [PATCH 05/13] swap, blkcg: issue swap io with the appropriate context Date: Tue, 29 May 2018 17:17:16 -0400 Message-Id: <20180529211724.4531-6-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180529211724.4531-1-josef@toxicpanda.com> References: <20180529211724.4531-1-josef@toxicpanda.com> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Tejun Heo For backcharging we need to know who the page belongs to when swapping it out. Signed-off-by: Tejun Heo Signed-off-by: Josef Bacik --- mm/page_io.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mm/page_io.c b/mm/page_io.c index a552cb37e220..61e1268e5dbc 100644 --- a/mm/page_io.c +++ b/mm/page_io.c @@ -339,6 +339,16 @@ int __swap_writepage(struct page *page, struct writeback_control *wbc, goto out; } bio->bi_opf = REQ_OP_WRITE | REQ_SWAP | wbc_to_write_flags(wbc); +#if defined(CONFIG_MEMCG) && defined(CONFIG_BLK_CGROUP) + if (page->mem_cgroup) { + struct cgroup_subsys_state *blkcg_css; + + blkcg_css = cgroup_get_e_css(page->mem_cgroup->css.cgroup, + &io_cgrp_subsys); + bio_associate_blkcg(bio, blkcg_css); + css_put(blkcg_css); + } +#endif count_swpout_vm_event(page); set_page_writeback(page); unlock_page(page);