From patchwork Tue Oct 22 20:15:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Weiner X-Patchwork-Id: 11205329 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D56B113B1 for ; Tue, 22 Oct 2019 20:15:22 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1F7521783 for ; Tue, 22 Oct 2019 20:15:22 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cmpxchg-org.20150623.gappssmtp.com header.i=@cmpxchg-org.20150623.gappssmtp.com header.b="G6GQH0AR" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1F7521783 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cmpxchg.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D413A6B0003; Tue, 22 Oct 2019 16:15:21 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id CF3086B0006; Tue, 22 Oct 2019 16:15:21 -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 BBE1C6B0007; Tue, 22 Oct 2019 16:15:21 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0192.hostedemail.com [216.40.44.192]) by kanga.kvack.org (Postfix) with ESMTP id 9A35E6B0003 for ; Tue, 22 Oct 2019 16:15:21 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 1E591180AD80F for ; Tue, 22 Oct 2019 20:15:21 +0000 (UTC) X-FDA: 76072525242.15.hair79_2ea0304d2a627 X-Spam-Summary: 2,0,0,0a6dd7305e4ac190,d41d8cd98f00b204,hannes@cmpxchg.org,:akpm@linux-foundation.org:mhocko@suse.com::cgroups@vger.kernel.org:linux-kernel@vger.kernel.org:kernel-team@fb.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1311:1314:1345:1437:1515:1534:1539:1711:1714:1730:1747:1777:1792:2393:2559:2562:3138:3139:3140:3141:3142:3351:3865:3866:3867:3870:3871:4321:5007:6261:6653:10004:11026:11658:11914:12297:12517:12519:12555:12895:13069:13311:13357:13894:14096:14181:14384:14394:14721:21080:21444:21451:21627:30012:30054,0,RBL:209.85.222.194:@cmpxchg.org:.lbl8.mailshell.net-62.14.0.100 66.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:25,LUA_SUMMARY:none X-HE-Tag: hair79_2ea0304d2a627 X-Filterd-Recvd-Size: 3597 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Oct 2019 20:15:20 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id a194so13477616qkg.10 for ; Tue, 22 Oct 2019 13:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=/6k43Ins8ShDUccC1LdBvMXrfhZMN86K2kUQuaiv7Mo=; b=G6GQH0AR0jPSft2ppe6Krr/rZ5GlNjjcDjh8uq21Mch7IOkfMJPJ6y8CGYHqjeZnRv Z82dyGlkUmpnrQUBDNlEbomTWJFZjTonGAtP+KWs1/C1lYr5lpWixX5fS4x8g1/pnjaI l+2sZb8+h8PVY95WqVGA2Z3wHkTZ5GJmzwN6p8slt1PJfa3X9acHSQ9TwJh6O9hoz8yK QoDS9inHtGfOdYETaFcmImy68omaIjrSwXUv00ynL3dDOGxlMHQeZN4xH1DKUj15Seb/ 4B+CZLYcbnEkE5LYhr+FWPasz/NfM9n5wmSZzFIvbKNULO+4fsvtj9SnmUeuv1klLi0C eunw== 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:mime-version :content-transfer-encoding; bh=/6k43Ins8ShDUccC1LdBvMXrfhZMN86K2kUQuaiv7Mo=; b=GyS1010m8AM+LYXDdRzcAUbcN4q6cdgbjCSmvAUCAl1bfa/TJrmEMG4EYKKQcNaWQO FL3BnMzBn+v18JI+kVjsI44bQmE+hPDOEvrIK+JXy8rHOWrcYaChi3dnq0KVhQ9g8Cif g4ok1nROnnWQ+WNdOoXlqc0AuozWeg3pJl1F1ANLTFdDEgEmyMUYkIRWpx3qR3Km1Fr+ vodk/5kd4FzKPgXUdj5xUnLGSkTc4SEyQ6t4gScUoEsoW2JF5/W8U8YhALQ3rqlenKyP GI0evBVq6LIx7iPUu6X+1syy3ULaZRTmbu2ex3tkVkDkRdh9Njtr5QsH5H1Dq2r0yRZo gXpw== X-Gm-Message-State: APjAAAXuXCAzTeaDFIaF395uzfCIX9KDzomVCPAI9Hrn/6hYtMP9BBSp xdPDvy0KHyWoCj8qBfSW2dn9DQ== X-Google-Smtp-Source: APXvYqwf83Q3oMgxGQXXVkIgEXOw8vw6FhbO2OSQt0mKSX9kQGxr6dmirL8tHiP1nzutNQLLmqtnhw== X-Received: by 2002:a37:f70f:: with SMTP id q15mr4521717qkj.428.1571775319334; Tue, 22 Oct 2019 13:15:19 -0700 (PDT) Received: from localhost ([2620:10d:c091:500::3:869e]) by smtp.gmail.com with ESMTPSA id d205sm11273855qke.96.2019.10.22.13.15.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Oct 2019 13:15:18 -0700 (PDT) From: Johannes Weiner To: Andrew Morton Cc: Michal Hocko , linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: [PATCH 1/2] mm: memcontrol: remove dead code from memory_max_write() Date: Tue, 22 Oct 2019 16:15:17 -0400 Message-Id: <20191022201518.341216-1-hannes@cmpxchg.org> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 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: When the reclaim loop in memory_max_write() is ^C'd or similar, we set err to -EINTR. But we don't return err. Once the limit is set, we always return success (nbytes). Delete the dead code. Signed-off-by: Johannes Weiner Acked-by: Michal Hocko --- mm/memcontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 055975b0b3a3..ff90d4e7df37 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -6122,10 +6122,8 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, if (nr_pages <= max) break; - if (signal_pending(current)) { - err = -EINTR; + if (signal_pending(current)) break; - } if (!drained) { drain_all_stock(memcg);