Received: by 10.223.148.5 with SMTP id 5csp7735778wrq; Thu, 18 Jan 2018 08:52:51 -0800 (PST) X-Google-Smtp-Source: ACJfBotrkF9ztw0RfB88JPCOKUAjlvqTHcMB8ZJRMb1rjtxw6lnBrKxSkAiBK77uzlGhP6xhEH7l X-Received: by 10.101.66.193 with SMTP id l1mr20294837pgp.17.1516294371157; Thu, 18 Jan 2018 08:52:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516294371; cv=none; d=google.com; s=arc-20160816; b=MKEyyPl9hHazd9fWyuDHWSoK/15KDjlNT7fjrBtb9Ky83WVAWgNUanrjz8VpAw4qz3 dqumFVytOzbYWh/sQlVZhfPeORXs7YXrYJX/vrbpj3DFMnj6j5jcGzTDrHRIEQB7wiv7 1+fF/+8V4XaZKhJR+975aQa8jEplGQKX0EPRz45q9N/WxXre6gjwpOWFPFc/jUFVu3BC E1GoRHKOai5Vd6rXT/xQr+kIeG/WTizy+uoH6RFcjVdKDvdLzEvLLQ91eQiNZLxanSGT BTPAP/TlbWbBg2vo3ivTuanBz8FrKGgW6NhWUIe2812Y3gGW1m3oAA7HDLtgtkNJVKIO jaOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=OMbhEDrGx2n7iz8GzR/RoA25CSrq4hNiFU3zbl7n8oU=; b=Me8oRxylRa8/wKeYUITODlgdDJOdmnsLP2EVeCyPXaj7twEwDwycdNnFJlXk8XQ9kQ 4l23WbCgMGiFOIKI3Sroz1MhwTO1R3Ziq9avJGWI/jFWxOKFZNFaXj9Wjc1YiG02MNmf jEJcg/0jCpOFf/iLcrqY67cmlihb0xTMYrdd8VQxiH9bUogHpHY4EW9nSJIHV20dQQET JVmJOKvzKd6YNm3/sY4v0U92da0DsbPQt6PuUteHwf1jCpql117JqQAuqIPXx7xMOo0t W54O63JdngPqPqEcrOTxHMaLdqhfrr4AaxSDQOX1c1CFzRACwbPu7mFjakqsWHZ+t9fb GxWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=YJjhfKAB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h190si6507081pge.146.2018.01.18.08.52.36; Thu, 18 Jan 2018 08:52:51 -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=@amdcloud.onmicrosoft.com header.s=selector1-amd-com header.b=YJjhfKAB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755321AbeARQsm (ORCPT + 99 others); Thu, 18 Jan 2018 11:48:42 -0500 Received: from mail-sn1nam02on0088.outbound.protection.outlook.com ([104.47.36.88]:33119 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755264AbeARQsj (ORCPT ); Thu, 18 Jan 2018 11:48:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=OMbhEDrGx2n7iz8GzR/RoA25CSrq4hNiFU3zbl7n8oU=; b=YJjhfKABrp/njY3S7tEXPDD2hW0HW/UvGeWrWuYA8j+s4b7xIZXNUJO+A4/hgbVuRoCUQ2fUP1QNYKkr4xH3szQZzggoERjgn9DF7YJAavseG4BQXUny2pH2PLP6q+TaxZPBGj2kxa/t4SvoPIfABZMMabl91Rxj8v4HqacziAM= Received: from CY1PR12CA0081.namprd12.prod.outlook.com (10.163.230.49) by DM5PR12MB1450.namprd12.prod.outlook.com (10.172.38.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.428.17; Thu, 18 Jan 2018 16:48:37 +0000 Received: from CO1NAM03FT039.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by CY1PR12CA0081.outlook.office365.com (2a01:111:e400:c42b::49) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.428.17 via Frontend Transport; Thu, 18 Jan 2018 16:48:37 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT039.mail.protection.outlook.com (10.152.81.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.345.12 via Frontend Transport; Thu, 18 Jan 2018 16:48:36 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.361.1; Thu, 18 Jan 2018 10:48:35 -0600 From: Andrey Grodzovsky To: , , , CC: , Andrey Grodzovsky Subject: [PATCH 1/4] fs: add OOM badness callback in file_operatrations struct. Date: Thu, 18 Jan 2018 11:47:49 -0500 Message-ID: <1516294072-17841-2-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> References: <1516294072-17841-1-git-send-email-andrey.grodzovsky@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(346002)(376002)(39380400002)(39860400002)(2980300002)(428003)(189003)(199004)(36756003)(104016004)(316002)(305945005)(76176011)(68736007)(53936002)(478600001)(16586007)(48376002)(50466002)(54906003)(110136005)(356003)(72206003)(106466001)(86362001)(2201001)(4326008)(105586002)(2906002)(77096007)(8676002)(81156014)(81166006)(50226002)(6666003)(8936002)(5660300001)(2950100002)(26005)(51416003)(53416004)(97736004)(7696005)(47776003)(2101003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1450;H:SATLEXCHOV02.amd.com;FPR:;SPF:None;PTR:InfoDomainNonexistent;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;CO1NAM03FT039;1:FxfHD2CS5bD/VBpSh3fLHhIKVxw1P8rRIOa2HoCaCuHx6LlloslFx/sU02pGtmiDrw4UzSV/iuK0uwjRWQIq0d/7o/s0aJo1RGdtjtP0pKUJLiWZy/IHKTIvPcuhQTeU X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 73bbbfa8-cdc3-4bde-967c-08d55e9351f2 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060);SRVR:DM5PR12MB1450; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1450;3:mYSYFhXzqpVzxPs+XkKQnA1rarH/pkJvnocYnLqih9xQE+EH/pTkGEXj0dk719ewMxOf4TPgbRRBopheroXRehUlgGhipZR3xpdMwoYRmz+sBdKMsd48CMWhyOZMcR8/iWUs+sBYv/njYqvltC3TbSPd21wlwDkwGMpz49Hfy3/yNB+AtRkkndtwVArj/ZQ7fV8ABQU535WhWmoLDl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guYNu/TuAje/99im052g3cLW0A9Z8f99cRbdVngvELwv0xzNawvBNIv7joqlH2sHB5CRRpm/n7yVeK0kD87OLOOnYidGwvtq0dIYe+Jf1n7fnV1a6XhUH0YB0EkI45NzaxH9/HoVQO0juWvAU4L7+CSXVayMJKDwQWcJKhfn2Bn0Jd5ABV4Fm9dlWiJxNxY31YA9VCKf9gRVpWERnxCd2i0Ce8SouywVEu0v9K X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(8121501046)(5005006)(93006095)(93003095)(3002001)(3231023)(2400064)(944501161)(10201501046)(6055026)(6041268)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:DM5PR12MB1450;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:DM5PR12MB1450; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1450;4:+6qKH2jOAtc03wKuFLqZQ80rsdWcY6U2/Mef22D9fvdddPiKYsgK/UUjgolxRzMO83nWj+S+NaRN4fpbW0sRgWv44FJhADbM0Jdfe7IWbgwqIyX74qf1HOQ8mTp4ki3pwTkcCQ+a56ZqPt1GgCG7ry87ThDjsX9jHucqEPUkwJLmQXEFENrKiFfiZjhPvfLidQtAnSmtP1wSYdhbOwLGC5A/N6hBr1KZxp0vFiaC1i8NohHJ+jp2atT02Wdvd6w/cXVWr7wgEmtT1aQEeMOwn1UUg6vNUmF+4febZnJ6tG8KTV0kAyU68kIjxlT5WEH9 X-Forefront-PRVS: 05568D1FF7 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR12MB1450;23:SCCDDlVfSLtPuqrTNiwxzTsUYhJyWU66dem2qJjuN?= =?us-ascii?Q?wj+OxPAef9JWt6ccjmVpRqAxXN8hLUBvDyQnm5J1cAQ5BZ9H8OccL1M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St+L3Md0ZIxyk8aKQJFmQzrEiGb1i SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1450;20:gmoaYW2l/OHZ2OLQxlKtOgbO6siWLyladMGIBggV1HF/RJkyNZUVlkNU6+TgeTKTdy8ERsiZWZY6/j9Nf5pehl9K5n83J6NuKLj1NbWrPSHvy0zCSPVJ+aP5F3Auw3RpGlCcCD3VmC3+9XghLCTOigG6aCttg/JYNAFTw7yXZmKS3N+qb9wA8GvKsLv9KmLNmuScuSYjyNVhYA28C5B8hDxg6ztYTYvEwyjwROfGyK64nFqDZ0/2N/HBM1xsqj6P X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 16:48:36.8974 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 73bbbfa8-cdc3-4bde-967c-08d55e9351f2 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1450 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This allows device drivers to specify an additional badness for the OOM when they allocate memory on behalf of userspace. Signed-off-by: Andrey Grodzovsky --- include/linux/fs.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/linux/fs.h b/include/linux/fs.h index 511fbaa..938394a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1728,6 +1728,7 @@ struct file_operations { u64); ssize_t (*dedupe_file_range)(struct file *, u64, u64, struct file *, u64); + long (*oom_file_badness)(struct file *); } __randomize_layout; struct inode_operations { -- 2.7.4